[Python-3000] removing destructuring del
Andrew Dalke
dalke at dalkescientific.com
Wed Feb 20 21:45:40 CET 2008
For lack of a better term, I'll call this a destructuring del
del (a, (b, (c)))
I propose that it should not be valid in Python 3.
It's supported in 2.x and 3.0a2. It's never caused anyone problems.
No one (that I can find through 10 minutes of grepping) uses it.
When I figured out that I could do it, by looking at the grammar, I
didn't believe it was valid. I still can't figure out why anyone
would use it.
Python 3 removes support for destructuring in function calls
def f((a,b)): # SyntaxError in Python3
pass
and I think this falls into the same category.
I would even argue that
del(x)
should not be allowed because it's suggests and is likely based on
the false belief that 'del' is a function call. But I'm not
proposing getting rid of return(x).
Andrew
dalke at dalkescientific.com
More information about the Python-3000
mailing list