On Thu, Apr 12, 2018 at 11:19 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 12 April 2018 at 07:28, Chris Angelico <ros...@gmail.com> wrote: >> On Thu, Apr 12, 2018 at 1:22 AM, Nick Coghlan <ncogh...@gmail.com> wrote: >>>> Frequently Raised Objections >>>> ============================ >>> >>> There needs to be a subsection here regarding the need to call `del` >>> at class and module scope, just as there is for loop iteration >>> variables at those scopes. >> >> Hmm, I'm not sure I follow. Are you saying that this is an objection >> to assignment expressions, or an objection to them not being >> statement-local? If the latter, it's really more about "rejected >> alternative proposals". > > It's both - accidentally polluting class and module namespaces is an > argument against expression level assignments in general, and sublocal > namespaces aimed to eliminate that downside. > > Since feedback on the earlier versions of the PEP has moved sublocal > namespaces into the "rejected due to excessive conceptual complexity" > box, that means accidental namespace pollution comes back as a > downside that the PEP should mention. > > I don't think it needs to say much, just point out that they share the > downside of regular for loops: if you use one at class or module > scope, and don't want to export the name, you need to delete it > explicitly. >
Ah, makes sense. Thanks. Have added that to the latest version. ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/