[Python-Dev] New dictionaries patch on SF (original) (raw)

Fred L. Drake, Jr. fdrake@beopen.com
Mon, 28 Aug 2000 11:19:44 -0400 (EDT)


Barry A. Warsaw writes:

Note that JPython does something similar for dictionaries that are used for namespaces. See PyStringMap.java.

The difference is that there are no code changes outside dictobject.c to make this useful for my proposal -- there isn't a new object type involved. The PyStringMap class is actually a different implementation (which I did dig into a bit at one point, to create versions that weren't bound to JPython). My modified dictionary objects are just dictionary objects that auto-degrade themselves as soon as a non-string key is looked up (including while setting values). But the approach and rational are very similar.

-Fred

-- Fred L. Drake, Jr. BeOpen PythonLabs Team Member