Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #96531 > unrolled thread

Auto indents (was Re: How to set the history commands visible ?)

Started byTerry Reedy <tjreedy@udel.edu>
First post2015-09-13 18:56 -0400
Last post2015-09-13 18:56 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Auto indents (was Re: How to set the history commands visible ?) Terry Reedy <tjreedy@udel.edu> - 2015-09-13 18:56 -0400

#96531 — Auto indents (was Re: How to set the history commands visible ?)

FromTerry Reedy <tjreedy@udel.edu>
Date2015-09-13 18:56 -0400
SubjectAuto indents (was Re: How to set the history commands visible ?)
Message-ID<mailman.504.1442185028.8327.python-list@python.org>
On 9/13/2015 1:15 PM, Glus Xof wrote:

> Is yet an automatic indentation system implemented ?

The Idle editor does pep8-aware 'smart indenting'.  In the following, 
'|' indicates the cursor position after <Enter> is pressed.
A ':' at the end of the line adds 1 indent -- unless there is an opener 
that has not been closed.  So what looks like a buggy indent usually 
indicates a syntax error in the user code.

a = 3
|
if a == 3:
     |pass
a = int(len({})
         |) # pep 8 positioning
a = int(
     |) # pep 8 positioning
if a = 3:
     if b = 5:
         |pass
if a == int(len({}):
             | # unclosed int(

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web