setslice of ``[0:0]`` correctly, which in particular could occur
when using ``insert(0, item)`` with the association proxy. Due
to some quirk in Python collections, the issue was much more likely
with Python 3 rather than 2. Also in 0.8.3, 0.7.11.
[ticket:2807]
Conflicts:
doc/build/changelog/changelog_09.rst
.. changelog::
:version: 0.7.11
+ .. change::
+ :tags: bug, orm
+ :tickets: 2807
+
+ Fixed bug where list instrumentation would fail to represent a
+ setslice of ``[0:0]`` correctly, which in particular could occur
+ when using ``insert(0, item)`` with the association proxy. Due
+ to some quirk in Python collections, the issue was much more likely
+ with Python 3 rather than 2.
+
.. change::
:tags: bug, sql
:tickets: 2801
.. changelog::
:version: 0.8.3
+ .. change::
+ :tags: bug, orm
+ :tickets: 2807
+
+ Fixed bug where list instrumentation would fail to represent a
+ setslice of ``[0:0]`` correctly, which in particular could occur
+ when using ``insert(0, item)`` with the association proxy. Due
+ to some quirk in Python collections, the issue was much more likely
+ with Python 3 rather than 2. Also in 0.7.11.
+
.. change::
:tags: bug, orm
:tickets: 2779
start = index.start or 0
if start < 0:
start += len(self)
- stop = index.stop or len(self)
+ if index.stop is not None:
+ stop = index.stop
+ else:
+ stop = len(self)
if stop < 0:
stop += len(self)
control = list()
def assert_eq():
- self.assert_(set(direct) == canary.data)
- self.assert_(set(adapter) == canary.data)
- self.assert_(direct == control)
+ eq_(set(direct), canary.data)
+ eq_(set(adapter), canary.data)
+ eq_(direct, control)
# assume append() is available for list tests
e = creator()
control[-2:-1] = values
assert_eq()
+ values = [creator()]
+ direct[0:0] = values
+ control[0:0] = values
+ assert_eq()
+
if hasattr(direct, '__delitem__') or hasattr(direct, '__delslice__'):
for i in range(1, 4):