[Python-Dev] PEP-0218

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Thu, 30 Nov 2000 10:44:38 +0200 (IST)

> Hmmm...actually, I've been wanting a method .key() for dictionaries
> a long time. So if we give dictionaries this one small method, then
> we *can* do this in Python.

> Shouldn't be hard to do... the C API for this is already in place:
> PyDict_Next(). I'd prefer a method .getitem(), though, which then
> returns a tuple (key, value).

Well, I'm sure the C API allows it. And if we do it, we might as well
do it right: add .key(), .value() and .item().

Moshe Zadka <moshez@math.huji.ac.il> -- 95855124