- put list.clear() instrumentation under "if not py2k"
.. 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
_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