New submission from Dan Snider:

k = 'k'
del [k]

That deletes the variable k from the local scope (even though it *looks* like 
it's trying to delete a list containing 1 element which is equivalent to the 
variable k).

But if using list literals to delete groups of objects is valid, then why not 
set literals?

del {k}
raises SyntaxError: can't delete literal

The better option imo would be to only allow tuples when del-ing groups of 
objects, but if list literals are allowed then set literals should be as well.

----------
components: Interpreter Core
messages: 293942
nosy: assume_away
priority: normal
severity: normal
status: open
title: Unexpected and/or inconsistent del behavior
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30402>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to