Arithmetic sequences in Python

Fredrik Lundh fredrik at pythonware.com
Thu Jan 19 04:27:11 EST 2006


Steven D'Aprano 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?

yes.

</F>






More information about the Python-list mailing list