DanielStutzbach / blist

A list-like type with better asymptotic performance and similar performance on small lists
Other
310 stars 36 forks source link

blist indexing is not working #43

Closed NeilGirdhar closed 11 years ago

NeilGirdhar commented 12 years ago

The code:

import blist
d = blist.sorteddict({3: "first", 7: "second"})
print(d.keys()[1])
print(d.values()[1])
print(d.items()[1])

gives the error

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    print(d.values()[1])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/_sorteddict.py", line 53, in __getitem__
    key = self._mapping.sortedkeys[index]
AttributeError: 'sorteddict' object has no attribute 'sortedkeys'

When this is fixed by adding the missing underscore to the name, another error pops up for the attribute "key". When that is fixed, it seems that the ItemsView isn't indexing properly.

NeilGirdhar commented 11 years ago

Any progress with this? It would be really nice to at least add the missing underscore for the "sortedkeys" property on two lines in sorteddict.py.

DanielStutzbach commented 11 years ago

Sorry for the delay. I should be able to find some time in the next 2 weeks to solve this and a number of other small issues, then put out a new release.

NeilGirdhar commented 11 years ago

Thank you Daniel. I (and many others I'm sure) really appreciate your work on this project.