diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-20 13:27:27 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-08-20 13:27:27 -0400 |
commit | b13a434f6fb2a947b284f589148aa8cb6974e3d5 (patch) | |
tree | 92e3b7e8b85bd36ec7d50d41b08c5cb22a614bce /lib/sqlalchemy | |
parent | 5b8e8598ab5c604d3ec20c0f6a3e6af06f879308 (diff) | |
download | sqlalchemy-b13a434f6fb2a947b284f589148aa8cb6974e3d5.tar.gz |
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.8.3, 0.7.11.
[ticket:2807]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/orm/collections.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/collections.py b/lib/sqlalchemy/orm/collections.py index f8f4b9583..6bd5ac968 100644 --- a/lib/sqlalchemy/orm/collections.py +++ b/lib/sqlalchemy/orm/collections.py @@ -1075,7 +1075,10 @@ def _list_decorators(): 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) |