diff options
| author | Катаев Денис <bteamko@gmail.com> | 2017-03-17 14:19:21 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-03-17 14:19:21 -0400 |
| commit | 8f7cf2990f9010ea4924f2525318dff0ba1028d7 (patch) | |
| tree | 3e0e4b44d8c4d5c8ae8e63b9ff5842770ec23515 /lib/sqlalchemy/ext | |
| parent | d96fc5d02a921820aa5973daf66445c880ca6cd4 (diff) | |
| download | sqlalchemy-8f7cf2990f9010ea4924f2525318dff0ba1028d7.tar.gz | |
New features from python 2.7
After bump minimum supported version to 2.7 (1da9d3752160430c91534a8868ceb8c5ad1451d4), we can use new syntax.
Change-Id: Ib064c75a00562e641d132f9c57e5e69744200e05
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/347
Diffstat (limited to 'lib/sqlalchemy/ext')
| -rw-r--r-- | lib/sqlalchemy/ext/automap.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/ext/mutable.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/ext/automap.py b/lib/sqlalchemy/ext/automap.py index 219bfe124..14599fe5e 100644 --- a/lib/sqlalchemy/ext/automap.py +++ b/lib/sqlalchemy/ext/automap.py @@ -906,7 +906,7 @@ def _relationships_for_fks(automap_base, map_config, table_to_map_config, ) o2m_kws = {} - nullable = False not in set([fk.parent.nullable for fk in fks]) + nullable = False not in {fk.parent.nullable for fk in fks} if not nullable: o2m_kws['cascade'] = "all, delete-orphan" diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index 3361c4475..79459b39c 100644 --- a/lib/sqlalchemy/ext/mutable.py +++ b/lib/sqlalchemy/ext/mutable.py @@ -421,7 +421,7 @@ class MutableBase(object): .. versionadded:: 1.0.5 """ - return set([attribute.key]) + return {attribute.key} @classmethod def _listen_on_attribute(cls, attribute, coerce, parent_cls): @@ -605,7 +605,7 @@ class MutableComposite(MutableBase): @classmethod def _get_listen_keys(cls, attribute): - return set([attribute.key]).union(attribute.property._attribute_keys) + return {attribute.key}.union(attribute.property._attribute_keys) def changed(self): """Subclasses should call this method whenever change events occur.""" |
