Nick Coghlan wrote:
x:= f():" implies "x" is already defined as a target somewhere else in the current scope, while "if x := f() given x:" potentially introduces "x" as a new local target
Noooo..... this is just taking a bad idea and making it worse, IMO. I'm -1 on any contortions designed to allow comprehensions to assign to things in outer scopes. All the proposed use cases I've seen for this have not improved readability over writing a function that does things the usual way. Can we please leave comprehensions as declarative constructs? The best tools do just one thing and do it well. These proposals seem to be trying to turn comprehensions into swiss army knives. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com