]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- changelog
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 30 Nov 2013 21:26:55 +0000 (16:26 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 30 Nov 2013 21:26:55 +0000 (16:26 -0500)
- put list.clear() instrumentation under "if not py2k"

doc/build/changelog/changelog_09.rst
lib/sqlalchemy/orm/collections.py

index 158a14058494ed0b5adff9acfa200a729e017f9f..1f72d0f26cd48b023dddd208c32a9df999b40ec3 100644 (file)
 .. changelog::
     :version: 0.9.0b2
 
+    .. change::
+        :tags: bug, orm, collections, py3k
+        :pullreq: github:40
+
+        Added support for the Python 3 method ``list.clear()`` within
+        the ORM collection instrumentation system; pull request
+        courtesy Eduardo Schettino.
+
     .. change::
         :tags: bug, postgresql
         :tickets: 2878
index ffd0b8c379bc2b6b4a28c3299b97b23a73d25283..b92b6954c8f5f74ef14de07050a4f6f3d600def5 100644 (file)
@@ -1161,13 +1161,14 @@ def _list_decorators():
         _tidy(pop)
         return pop
 
-    def clear(fn):
-        def clear(self, index=-1):
-            for item in self:
-                __del(self, item)
-            fn(self)
-        _tidy(clear)
-        return clear
+    if not util.py2k:
+        def clear(fn):
+            def clear(self, index=-1):
+                for item in self:
+                    __del(self, item)
+                fn(self)
+            _tidy(clear)
+            return clear
 
     # __imul__ : not wrapping this.  all members of the collection are already
     # present, so no need to fire appends... wrapping it with an explicit