Arithmetic sequences in Python

Steven D'Aprano steve at REMOVEMEcyber.com.au
Thu Jan 19 09:53:36 CET 2006


Alex Martelli wrote:

> I much prefer the current arrangement where dict(a=b,c=d) means {'a':b,
> 'c':d} -- it's much more congruent to how named arguments work for every
> other case.  Would you force us to quote argument names in EVERY
> functioncall...?!


Hmmm... should these two forms give different results?

 >>> a = 0
 >>> b = 1
 >>> A = {a: b}
 >>> B = dict(a=b)
 >>> A, B
({0: 1}, {'a': 1})

I feel very uncomfortable about that. Am I alone?


-- 
Steven.




More information about the Python-list mailing list