def projections(value, match_value=True):
if match_value and isinstance(value, collections.Hashable):
yield value
traits = getattr(value, "MATCH_TRAITS", None)
if traits is not None:
if isinstance(traits, tuple):
for t in traits:
yield t
else:
yield traits
if not isinstance(value, Marker):
if isinstance(value, super):
for cls in value.__self_class__.__mro__[1:]:
yield cls
else:
for cls in value.__class__.__mro__:
yield cls
评论列表
文章目录