[Python-ideas] Proposal: New syntax for OrderedDict, maybe built-in

Jason Bursey kn0m0n3 at gmail.com
Thu Sep 4 20:14:02 CEST 2014


Any word on when Richard will be releasing a fsf/gnu friendly cell phone?

thanks,
Jason
s.o.f.t.



www.leap.cc


















On Thu, Sep 4, 2014 at 1:11 PM, Norman Hooper <norman at kaapstorm.com> wrote:

> Hi,
>
>
> On 09/04/2014 08:00 PM, David Wilson wrote:
>
>> On Thu, Sep 04, 2014 at 07:35:06PM +0200, Norman Hooper wrote:
>>
>>  I work with OrderedDict a lot, because JSON represents an OrderedDict
>>> and I need to work with JSON a lot.
>>>
>> ECMAScript:
>>
>>      4.3.3 Object
>>      An object is a member of the type Object. It is an unordered
>>      collection of properties each of which contains a primitive value,
>>      object, or function. A function stored in a property of an object is
>>      called a method.
>>
>> JSON:
>>
>>      1. Introduction
>>      An object is an unordered collection of zero or more name/value
>>      pairs, where a name is a string and a value is a string, number,
>>      boolean, null, object, or array.
>>
>>
> You are absolutely right. And as you point out ...
>
>
>  implementations
>> tend to preserve order when the number of keys is small, since they may
>> use a more efficient internal representation in that case, whose
>> enumeration order depends on order the properties were defined in.
>>
>
> I am not aware of any implementations (although I'm also not aware of all
> implementations) that do not preserve order.
>
> So (a bit like natural languages) one needs to conform with how it is
> used, not how it is defined, if one wants to be fully understood.
>
> Kind regards,
>
> Norman
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140904/eeedf76a/attachment.html>


More information about the Python-ideas mailing list