You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if the key is outside the range allowed, it fails:
>>> x =2**64
>>> x in bt
OverflowError: Python int too large to convert to C long
>>> bt.get(x)
OverflowError: Python int too large to convert to C long
For consistency, the OverflowError should be ignored in those cases too. (This would happen automatically if it was a TypeError instead of an OverflowError.) The pure-Python implementation already handles this (…by raising a TypeError, I think).
Also weird and should not raise (works in pure-Python):
>>> bt.has_key(1)
0
>>> bt.has_key('abc')
KeyError: 'abc'
>>> bt.has_key(x)
OverflowError: Python int too large to convert to C long
Confirmed this to be an issue back to 4.6. The changes in 4.3.2 were not sufficient for the overflow case.
The text was updated successfully, but these errors were encountered:
Currently,
key in btree
ignores TypeError, so this all works:But if the key is outside the range allowed, it fails:
For consistency, the
OverflowError
should be ignored in those cases too. (This would happen automatically if it was aTypeError
instead of anOverflowError
.) The pure-Python implementation already handles this (…by raising a TypeError, I think).Also weird and should not raise (works in pure-Python):
Confirmed this to be an issue back to 4.6. The changes in 4.3.2 were not sufficient for the overflow case.
The text was updated successfully, but these errors were encountered: