1. idank
  2. sqlalchemy

Commits

Mike Bayer  committed 8d0319b

remove "is None" from boolean tests

  • Participants
  • Parent commits cd76231
  • Branches default

Comments (0)

Files changed (1)

File lib/sqlalchemy/orm/mapper.py

View file
             if ret is not EXT_CONTINUE:
                 row = ret
 
-        if not refresh_instance and not skip_polymorphic and self.polymorphic_on is not None:
+        if not refresh_instance and not skip_polymorphic and self.polymorphic_on:
             discriminator = row[self.polymorphic_on]
-            if discriminator is not None:
+            if discriminator:
                 mapper = self.polymorphic_map[discriminator]
                 if mapper is not self:
                     if ('polymorphic_fetch', mapper) not in context.attributes: