(
class_: Type[Any],
key: str,
*,
comparator: interfaces.PropComparator[_T],
parententity: _InternalEntityType[Any],
doc: Optional[str] = None,
)
| 2671 | |
| 2672 | |
| 2673 | def _register_descriptor( |
| 2674 | class_: Type[Any], |
| 2675 | key: str, |
| 2676 | *, |
| 2677 | comparator: interfaces.PropComparator[_T], |
| 2678 | parententity: _InternalEntityType[Any], |
| 2679 | doc: Optional[str] = None, |
| 2680 | ) -> InstrumentedAttribute[_T]: |
| 2681 | manager = manager_of_class(class_) |
| 2682 | |
| 2683 | descriptor = InstrumentedAttribute( |
| 2684 | class_, key, comparator=comparator, parententity=parententity |
| 2685 | ) |
| 2686 | |
| 2687 | descriptor.__doc__ = doc # type: ignore |
| 2688 | |
| 2689 | manager.instrument_attribute(key, descriptor) |
| 2690 | return descriptor |
| 2691 | |
| 2692 | |
| 2693 | def _unregister_attribute(class_: Type[Any], key: str) -> None: |
no test coverage detected