pyrex bug: dict del with C int key doesn't work
"C. Titus Brown" <[email protected]> Fri, 24 Oct 2008 20:07:52 -0700
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
over in pygr-dev, we noticed an odd error that I tracked down to pyrex:
http://groups.google.com/group/pygr-dev/browse_thread/thread/123a4a6b92d7abe8
Briefly, in pyrex release 0.9.7 and up,
cdef int key
key = 0
d = {}
d[key]
del d[key]
fails with the error
TypeError: 'dict' object doesn't support item deletion
which is of course absurd :)
Looking at CHANGES.txt, this looks like yet another bug linked to
optimization of indexing maps using a C integer (see 0.9.7.1 and .2
release notes).
There are two possible interim fixes: first, you can not declare 'key'
as a C int, or second, you can just use __delitem__ directly. But
ultimately, of course, it'd be nice to get this fixed in pyrex!
I've attached a .tar.gz containing code demonstrating the bug. Please
let me know if there's anything else I can do!
cheers,
--titus
--
C. Titus Brown, [email protected]
_______________________________________________
Pyrex mailing list
[email protected]
http://lists.copyleft.no/mailman/listinfo/pyrex
pyrex-delint-bug.tar.gz
(application/octet-stream, 544 B) - not displayed