(mc: MappedClassProtocol[Any])
| 2115 | mapped_cls = cast("MappedClassProtocol[Any]", cls) |
| 2116 | |
| 2117 | def _table_or_raise(mc: MappedClassProtocol[Any]) -> Table: |
| 2118 | if isinstance(mc.__table__, Table): |
| 2119 | return mc.__table__ |
| 2120 | raise exc.InvalidRequestError( |
| 2121 | f"Cannot add a new attribute to mapped class {mc.__name__!r} " |
| 2122 | "because it's not mapped against a table." |
| 2123 | ) |
| 2124 | |
| 2125 | if isinstance(value, Column): |
| 2126 | _undefer_column_name(key, value) |