summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/associationproxy.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-04-27 19:53:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-04-27 19:53:57 -0400
commit4b614b9b35cd2baddb7ca67c04bee5d70ec6a172 (patch)
tree7483cd269f5823f903f96709eb864fff9b6d9383 /lib/sqlalchemy/ext/associationproxy.py
parent9716a5c45e6185c5871555722d8495880f0e8c7a (diff)
downloadsqlalchemy-4b614b9b35cd2baddb7ca67c04bee5d70ec6a172.tar.gz
- the raw 2to3 run
- went through examples/ and cleaned out excess list() calls
Diffstat (limited to 'lib/sqlalchemy/ext/associationproxy.py')
-rw-r--r--lib/sqlalchemy/ext/associationproxy.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py
index 252efcb42..ad09db831 100644
--- a/lib/sqlalchemy/ext/associationproxy.py
+++ b/lib/sqlalchemy/ext/associationproxy.py
@@ -475,7 +475,7 @@ class _AssociationCollection(object):
def __len__(self):
return len(self.col)
- def __nonzero__(self):
+ def __bool__(self):
return bool(self.col)
def __getstate__(self):
@@ -514,7 +514,7 @@ class _AssociationList(_AssociationCollection):
stop = index.stop
step = index.step or 1
- rng = range(index.start or 0, stop, step)
+ rng = list(range(index.start or 0, stop, step))
if step == 1:
for i in rng:
del self[index.start]
@@ -569,7 +569,7 @@ class _AssociationList(_AssociationCollection):
def count(self, value):
return sum([1 for _ in
- itertools.ifilter(lambda v: v == value, iter(self))])
+ filter(lambda v: v == value, iter(self))])
def extend(self, values):
for v in values:
@@ -668,8 +668,8 @@ class _AssociationList(_AssociationCollection):
def __hash__(self):
raise TypeError("%s objects are unhashable" % type(self).__name__)
- for func_name, func in locals().items():
- if (util.callable(func) and func.func_name == func_name and
+ for func_name, func in list(locals().items()):
+ if (util.callable(func) and func.__name__ == func_name and
not func.__doc__ and hasattr(list, func_name)):
func.__doc__ = getattr(list, func_name).__doc__
del func_name, func
@@ -711,7 +711,7 @@ class _AssociationDict(_AssociationCollection):
return key in self.col
def __iter__(self):
- return self.col.iterkeys()
+ return iter(self.col.keys())
def clear(self):
self.col.clear()
@@ -738,7 +738,7 @@ class _AssociationDict(_AssociationCollection):
return cmp(dict(self), other)
def __repr__(self):
- return repr(dict(self.items()))
+ return repr(dict(list(self.items())))
def get(self, key, default=None):
try:
@@ -754,13 +754,13 @@ class _AssociationDict(_AssociationCollection):
return self[key]
def keys(self):
- return self.col.keys()
+ return list(self.col.keys())
def iterkeys(self):
- return self.col.iterkeys()
+ return iter(self.col.keys())
def values(self):
- return [self._get(member) for member in self.col.values()]
+ return [self._get(member) for member in list(self.col.values())]
def itervalues(self):
for key in self.col:
@@ -811,13 +811,13 @@ class _AssociationDict(_AssociationCollection):
self[key] = value
def copy(self):
- return dict(self.items())
+ return dict(list(self.items()))
def __hash__(self):
raise TypeError("%s objects are unhashable" % type(self).__name__)
- for func_name, func in locals().items():
- if (util.callable(func) and func.func_name == func_name and
+ for func_name, func in list(locals().items()):
+ if (util.callable(func) and func.__name__ == func_name and
not func.__doc__ and hasattr(dict, func_name)):
func.__doc__ = getattr(dict, func_name).__doc__
del func_name, func
@@ -838,7 +838,7 @@ class _AssociationSet(_AssociationCollection):
def __len__(self):
return len(self.col)
- def __nonzero__(self):
+ def __bool__(self):
if self.col:
return True
else:
@@ -1014,8 +1014,8 @@ class _AssociationSet(_AssociationCollection):
def __hash__(self):
raise TypeError("%s objects are unhashable" % type(self).__name__)
- for func_name, func in locals().items():
- if (util.callable(func) and func.func_name == func_name and
+ for func_name, func in list(locals().items()):
+ if (util.callable(func) and func.__name__ == func_name and
not func.__doc__ and hasattr(set, func_name)):
func.__doc__ = getattr(set, func_name).__doc__
del func_name, func