Dictionary from list?

Guido van Rossum guido at python.org
Wed Oct 31 19:02:16 CET 2001

Greg Chapman <glchapman at earthlink.net> writes:

> By the way, in thinking about situation (a), I was wondering how much of a
> slow-down would be involved if PyDict_XXX calls were changed to PyMapping_XXX
> (I'm not advocating that, I was just curious).

I haven't measured it but am convinced that it would be an enormous

> Anyway, while doing so, I
> happened to notice the following two macros in abstract.h:
> #define PyMapping_DelItemString(O,K) PyDict_DelItemString((O),(K))
> #define PyMapping_DelItem(O,K) PyDict_DelItem((O),(K))
> I assume those are oversights?  It seems to me they should delegate to
> PyObject_DelItem (and PyObject_DelItemString, which will have to be added).

Yes, these are oversights.  I've submitted a SF bug report so they
will eventually be fixed.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-list mailing list