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

Method self_and_descendants

lib/sqlalchemy/orm/mapper.py:3402–3415  ·  view source on GitHub ↗

The collection including this mapper and all descendant mappers. This includes not just the immediately inheriting mappers but all their inheriting mappers as well.

(self)

Source from the content-addressed store, hash-verified

3400
3401 @HasMemoized.memoized_attribute
3402 def self_and_descendants(self) -> Sequence[Mapper[Any]]:
3403 """The collection including this mapper and all descendant mappers.
3404
3405 This includes not just the immediately inheriting mappers but
3406 all their inheriting mappers as well.
3407
3408 """
3409 descendants = []
3410 stack = deque([self])
3411 while stack:
3412 item = stack.popleft()
3413 descendants.append(item)
3414 stack.extend(item._inheriting_mappers)
3415 return util.WeakSequence(descendants)
3416
3417 def polymorphic_iterator(self) -> Iterator[Mapper[Any]]:
3418 """Iterate through the collection including this mapper and

Callers

nothing calls this directly

Calls 2

appendMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected