diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2022-11-17 14:35:10 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-11-17 14:35:10 +0000 |
commit | 60cc662861232ac40bcfd0461b1b1845b643464a (patch) | |
tree | 97b8ca4a8e98aa1210bccc6051c60df13585d7c5 /lib/sqlalchemy/orm/util.py | |
parent | 200e70b9745f1f344be4a35bb8f2b5f01b40d467 (diff) | |
parent | 4eb4ceca36c7ce931ea65ac06d6ed08bf459fc66 (diff) | |
download | sqlalchemy-60cc662861232ac40bcfd0461b1b1845b643464a.tar.gz |
Merge "Try running pyupgrade on the code" into main
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r-- | lib/sqlalchemy/orm/util.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index 50eba5d4c..e5bdbaa4f 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -1011,7 +1011,7 @@ class AliasedInsp( our_classes = util.to_set( mp.class_ for mp in self.with_polymorphic_mappers ) - new_classes = set([mp.class_ for mp in other.with_polymorphic_mappers]) + new_classes = {mp.class_ for mp in other.with_polymorphic_mappers} if our_classes == new_classes: return other else: @@ -1278,8 +1278,7 @@ class LoaderCriteriaOption(CriteriaOption): def _all_mappers(self) -> Iterator[Mapper[Any]]: if self.entity: - for mp_ent in self.entity.mapper.self_and_descendants: - yield mp_ent + yield from self.entity.mapper.self_and_descendants else: assert self.root_entity stack = list(self.root_entity.__subclasses__()) @@ -1290,8 +1289,7 @@ class LoaderCriteriaOption(CriteriaOption): inspection.inspect(subclass, raiseerr=False), ) if ent: - for mp in ent.mapper.self_and_descendants: - yield mp + yield from ent.mapper.self_and_descendants else: stack.extend(subclass.__subclasses__()) |