plasma-umass / Ninia

Python interpreter in JavaScript
Other
20 stars 8 forks source link

__setitem__ for Py_List #21

Closed geremih closed 9 years ago

geremih commented 9 years ago

Implemented setitem for Py_List for slice arguments. Added getIndices() function to Py_Slice. This is congruent with PySlice_GetIndicesEx in CPython. Also, fixed the implementation of getitem for slices, the previous implementation did not account for negative steps.

Also, added getArray() to Py_List, so that the contents of Py_List can be accessed without having to iterate over it using an iterator or using __getitem__, which would create a new Py_Int object for every access.

perimosocordiae commented 9 years ago

Thanks, this was great! I had to manually merge with some changes I made last night.