[Python-ideas] Proposal: New syntax for OrderedDict, maybe built-in
Skip Montanaro
skip at pobox.com
Thu Sep 4 20:24:38 CEST 2014
On Thu, Sep 4, 2014 at 1:18 PM, David Wilson <dw+python-ideas at hmmz.org>
wrote:
> $ jsc
> >>> function keys(o) {
> ... var k = [];
> ... for(var key in o) k.push(key);
> ... return k;
> ... }
> undefined
> >>> keys({"5": 1, "4": 1})
> 4,5
>
I love a simple existence proof!
Can we now discard the presumed equivalence of OrderDict and JS objects?
Besides, even if JS and Python were the only two languages we cared about,
JSON is supported in many other languages. I'd be really surprised if all
of them guaranteed key order. If fact, I wouldn't be surprised if none of
them did.
Skip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140904/53c19af2/attachment-0001.html>
More information about the Python-ideas
mailing list