-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a bug in ArrayBasedModel bounds setting in Python 3 (#285)
* Fixed a bug in ArrayBasedModel bounds setting in Python 3. See https://groups.google.com/forum/#!topic/cobra-pie/-Yfx7atjII8 Python 3 calls only __setitem__ and not __setslice__ as Python 2 and there was an error in the LinkedArray class in __setitem__ where it would assign all the values to each attribute in place of assigning each value to the correct attribute. Also added a unit test so that behavior is checked in the future... * Refactoring and fixed another bug. The __setslice__ did not handle the l[i:j] = [...] case correctly. It would try to access elements i to j in [...] as well and not 0 to j-i as it should be.
- Loading branch information
Showing
2 changed files
with
25 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters