[Python-3000] self-contained exceptions

Terry Reedy tjreedy at udel.edu
Thu Jan 11 21:33:50 CET 2007


"Guido van Rossum" <guido at python.org> wrote in message 
news:ca471dc20701110947l75f38833lfd37b210859c5219 at mail.gmail.com...
| The case for changing 'for' is weakest, for sure.

As I understand the proposal, the rationale for restricting the exception 
target is the autodeletion, which is obviously bug-prone if applied to 
pre-existing structures.  But this does not apply here.  Indeed, if you 
restrict the for-loop target the same as the exception target, you will 
increase people's expection that it is block-scope limited and probably 
stimulate even more questions/proposals about the 'inconsistency'.

So I agree with Phillip on for loop targets and leave them consistent with 
explicit assignment targets, which they will otherwise continue to act 
like.

| But 'with' is easy
| to coerce into the same category as 'import' and 'except' since it
| already uses 'as'...

Yes, I already see it that way.  It would be nice if the rule for 'as' 
targets were as consistent as possible (ie, at least the same for except 
and with)

Terry Jan Reedy





More information about the Python-3000 mailing list