(mc: MappedClassProtocol[Any])
| 2215 | mapped_cls = cast("MappedClassProtocol[Any]", cls) |
| 2216 | |
| 2217 | def _table_or_raise(mc: MappedClassProtocol[Any]) -> Table: |
| 2218 | if isinstance(mc.__table__, Table): |
| 2219 | return mc.__table__ |
| 2220 | raise exc.InvalidRequestError( |
| 2221 | f"Cannot add a new attribute to mapped class {mc.__name__!r} " |
| 2222 | "because it's not mapped against a table." |
| 2223 | ) |
| 2224 | |
| 2225 | if isinstance(value, Column): |
| 2226 | _undefer_column_name(key, value) |