summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-06-03 13:13:16 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-06-03 13:13:16 -0400
commit74c98bf182a1cac1ca1837da69e1c0550beaaab5 (patch)
tree4815d198d2aa4a6497330fb5d81e53bf4acfbb2d /lib/sqlalchemy/orm/attributes.py
parentff399ac75074916045410cedae72489cb60e8b50 (diff)
parentc2a158c137ee07a146f02e5ee89ec42e486c6a37 (diff)
downloadsqlalchemy-74c98bf182a1cac1ca1837da69e1c0550beaaab5.tar.gz
Merge branch 'master' into ticket_1068
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r--lib/sqlalchemy/orm/attributes.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 3eda127fd..bfba695b8 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -386,8 +386,8 @@ def create_proxied_attribute(descriptor):
return getattr(self.comparator, attribute)
except AttributeError:
raise AttributeError(
- 'Neither %r object nor %r object associated with %s '
- 'has an attribute %r' % (
+ 'Neither %r object nor %r object associated with %s '
+ 'has an attribute %r' % (
type(descriptor).__name__,
type(self.comparator).__name__,
self,
@@ -866,7 +866,7 @@ class CollectionAttributeImpl(AttributeImpl):
self.collection_factory = typecallable
def __copy(self, item):
- return [y for y in list(collections.collection_adapter(item))]
+ return [y for y in collections.collection_adapter(item)]
def get_history(self, state, dict_, passive=PASSIVE_OFF):
current = self.get(state, dict_, passive=passive)
@@ -1214,8 +1214,9 @@ class History(History):
"""
- def __nonzero__(self):
+ def __bool__(self):
return self != HISTORY_BLANK
+ __nonzero__ = __bool__
def empty(self):
"""Return True if this :class:`.History` has no changes