| 522 | return inst # type: ignore # TODO |
| 523 | |
| 524 | def _calc_owner(self, target_cls: Any) -> Any: |
| 525 | # we might be getting invoked for a subclass |
| 526 | # that is not mapped yet, in some declarative situations. |
| 527 | # save until we are mapped |
| 528 | try: |
| 529 | insp = inspect(target_cls) |
| 530 | except exc.NoInspectionAvailable: |
| 531 | # can't find a mapper, don't set owner. if we are a not-yet-mapped |
| 532 | # subclass, we can also scan through __mro__ to find a mapped |
| 533 | # class, but instead just wait for us to be called again against a |
| 534 | # mapped class normally. |
| 535 | return None |
| 536 | else: |
| 537 | return insp.mapper.class_manager.class_ |
| 538 | |
| 539 | def _default_getset( |
| 540 | self, collection_class: Any |