Commits

Mike Bayer committed 8d0319b

remove "is None" from boolean tests

Comments (0)

Files changed (1)

lib/sqlalchemy/orm/mapper.py

             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: