On 2018-07-19 14:26, Stephan Houben wrote:
FWIW, I like ??
It is short and distinctive.
There is prior art in this spelling in c#.
It requires no new keyword, nor does it give new meaning to an existing one.
I understand why ?[ needs to be spelled using only a single ?, but I am
afraid it will be used infrequently, and people will accidentally write
a??[x]
which is legal but different.
I found the example code in the PEP using ?. and ?[ hard to read.
?? and ??= are compelling, though.
One more question: what does this do?
del x
x ??= 42
Well, what does this do?
del x
if x is None:
x = 42
[snip]
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/