Use of a variable in parent loop

Stephane Tougard stephane at sdf.org
Sat Sep 26 15:36:48 EDT 2020


On 2020-09-26, Terry Reedy <tjreedy at udel.edu> wrote:
> Noise.  Only 'pass' when there is no other code.

Why ?

I use pass and continue each time to break a if or a for because emacs
understands it and do not break the indentation.

Is there any other instruction to end a if than pass and ensure Emacs
does not break the indentation during a copy paste or an indent-region ?

> Aside from not breaking most every existing Python program?  If block 
> scoped, one would have to add an otherwise useless fake declaration 
> before the block to use the name outside the block.  Python tries to 
> avoid boilerplate code.

I'm not talking about a general change in Python as a language, I'm
talking about a module who would enforce a block namespace as it works with
C or Perl (and many).

In Perl, use strict will break any non-strict code. So each is free to
chose between strict and not strict.

Anyway, there's no perfect language, the point is to know it. It's just
confusing I still have to declare or not declare an object depending on
the action I have with it. 



More information about the Python-list mailing list