[Python-ideas] Possible method of distinguishing between set-literals, dict-literals, and odict-literals

spir denis.spir at free.fr
Tue Jun 16 20:49:38 CEST 2009


Le Tue, 16 Jun 2009 18:46:21 +0100,
MRAB <python at mrabarnett.plus.com> s'exprima ainsi:

> How about ['a':'1', 'b':'2', 'c':'3']?
(for ordered dict literal)

I really find this sensible.
We have then:
* [a, b, c] & [k1:v1, k2:v2, k3:v3] for ordered containers
* {a, b, c} & {k1:v1, k2:v2, k3:v3} for unordered ones

+1.0 for me

Update: confusion of 1-item ordered dict with slice? Or just the same as confusion of 1-item list with index? (Note: have always found that [] and [:] for index and slice was somewhat wrong).

Denis
------
la vita e estrany



More information about the Python-ideas mailing list