MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / self_and_descendants

Method self_and_descendants

lib/sqlalchemy/orm/mapper.py:3360–3373  ·  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

3358
3359 @HasMemoized.memoized_attribute
3360 def self_and_descendants(self) -> Sequence[Mapper[Any]]:
3361 """The collection including this mapper and all descendant mappers.
3362
3363 This includes not just the immediately inheriting mappers but
3364 all their inheriting mappers as well.
3365
3366 """
3367 descendants = []
3368 stack = deque([self])
3369 while stack:
3370 item = stack.popleft()
3371 descendants.append(item)
3372 stack.extend(item._inheriting_mappers)
3373 return util.WeakSequence(descendants)
3374
3375 def polymorphic_iterator(self) -> Iterator[Mapper[Any]]:
3376 """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