Steven D'Aprano wrote:
> # Dotted names
> from types import SimpleNamespace
> obj = SimpleNamespace()
> obj.spam = **{'obj.spam': 1}
> assert obj.spam == 1
> 
> # Subscripts
> arr = [None]*5
> arr[1], arr[3] = **{'arr[3]': 33, 'arr[1]': 11}
> assert arr == [None, 11, None, 33, None]

Currently in Python `arr[1]` is the same as `arr[ 1 ]` (notice the added 
spaces). How is it taken into account in you proposal, does one match and the 
other doesn't ? Are those line equivalent or not :

arr[1], arr[3] = **{'arr[3]': 33, 'arr[1]': 11}
arr[ 1 ], arr[ 3 ] = **{'arr[3]': 33, 'arr[1]': 11}
arr[1], arr[3] = **{'arr[ 3 ]': 33, 'arr[ 1 ]': 11}

If not that would mean that the style of writing changes the execution of the 
program, which was never the case before AFAIK.

Joseph
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/MQB3M4EYCLVRJDSWATULUTTFDX3VJK6F/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to