Use of a variable in parent loop

Chris Angelico rosuav at gmail.com
Sun Sep 27 18:54:33 EDT 2020


On Mon, Sep 28, 2020 at 7:50 AM Stephane Tougard via Python-list
<python-list at python.org> wrote:
>
> On 2020-09-27, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
> >>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 ?
> >
> >   We usually do not wish to tie our code to a defective editor.
> >   I use vi, and can assure you that there is no such restriction
> >   in a real editor.
>
> It's funny, I've made a few tests and I see that pass has no impact on
> if block in fact, I can put it anywhere and add code behind, it works
> fine. I was sure that pass was breaking the if block, it does not.
>
> That's however still the way Emacs seems to see it (I can not add
> any code in a if block after a pass, pass acts as if it breaks the if
> block).

Well, then Emacs is the thing breaking it, because the 'pass'
statement has absolutely no code associated with it. It's equivalent
to an empty pair of braces in C.

Or maybe Emacs *isn't* breaking it, and it's just an autoindentation
thing. I don't know.

ChrisA


More information about the Python-list mailing list