Why are there no ordered dictionaries?

Fredrik Lundh fredrik at pythonware.com
Tue Nov 22 04:14:41 EST 2005


Alex Martelli wrote:

> What about PHP?  Thanks!

according to some random PHP documentation I found on the intarweb:

    An array in PHP is actually an ordered map. A map is a type that
    maps values to keys.

and later:

    A key may be either an integer or a string. If a key is the standard
    representation of an integer, it will be interpreted as such (i.e. "8"
    will be interpreted as 8, while "08" will be interpreted as "08"). Floats
    in key are truncated to integer.

and later:

    You cannot use arrays or objects as keys. Doing so will result in a
    warning: Illegal offset type.


at which point my brain raised an exception.

</F>






More information about the Python-list mailing list