MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _canload

Method _canload

lib/sqlalchemy/orm/mapper.py:3378–3385  ·  view source on GitHub ↗
(
        self, state: InstanceState[Any], allow_subtypes: bool
    )

Source from the content-addressed store, hash-verified

3376 )
3377
3378 def _canload(
3379 self, state: InstanceState[Any], allow_subtypes: bool
3380 ) -> bool:
3381 s = self.primary_mapper()
3382 if self.polymorphic_on is not None or allow_subtypes:
3383 return _state_mapper(state).isa(s)
3384 else:
3385 return _state_mapper(state) is s
3386
3387 def isa(self, other: Mapper[Any]) -> bool:
3388 """Return True if the this mapper inherits from the given mapper."""

Callers 1

_verify_canloadMethod · 0.80

Calls 3

primary_mapperMethod · 0.95
_state_mapperFunction · 0.85
isaMethod · 0.80

Tested by

no test coverage detected