summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2017-04-27 05:16:19 -0700
committerTim Graham <timograham@gmail.com>2017-04-27 08:16:19 -0400
commit7be94e033557ec984f53f8a67bd3326ee5a83b4a (patch)
tree0c6116f0fb53adb0dcc17d81ecaeb8e1a4742a9d /django/db
parent59f8118c86af7641f23a9f2c2e0812c8b1ba47dd (diff)
Replaced set |= operator with update() to avoid temporary set.
Diffstat (limited to 'django/db')
-rw-r--r--django/db/models/base.py2
-rw-r--r--django/db/models/sql/query.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 3c1cb9a119..28c2699043 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -204,7 +204,7 @@ class ModelBase(type):
if base not in parents or not hasattr(base, '_meta'):
# Things without _meta aren't functional models, so they're
# uninteresting parents.
- inherited_attributes |= set(base.__dict__.keys())
+ inherited_attributes.update(base.__dict__)
continue
parent_fields = base._meta.local_fields + base._meta.local_many_to_many
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 5c3eca0032..a1c1c4be38 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1017,7 +1017,7 @@ class Query:
)
# The used_joins for a tuple of expressions is the union of
# the used_joins for the individual expressions.
- used_joins |= set(k for k, v in self.alias_refcount.items() if v > pre_joins.get(k, 0))
+ used_joins.update(k for k, v in self.alias_refcount.items() if v > pre_joins.get(k, 0))
# For Oracle '' is equivalent to null. The check needs to be done
# at this stage because join promotion can't be done at compiler
# stage. Using DEFAULT_DB_ALIAS isn't nice, but it is the best we