Python syntax in Lisp and Scheme

David Eppstein eppstein at ics.uci.edu
Wed Oct 15 14:10:44 EDT 2003


In article <yfsr81e4eym.fsf at black132.ex.ac.uk>,
 Alexander Schmolck <a.schmolck at gmx.net> wrote:

> > But let us consider cutting lines 6 and 7 and putting them
> > between lines 21 and 22.  We get this: 
> > 
> > 15     while stack:
> > 16         directory = stack.pop()
> > 17         for file in os.listdir(directory):
> > 18             fullname = os.path.join(directory, file)
> > 19             files.append(fullname)
> > 20             if os.path.isdir(fullname) and not os.path.islink(fullname):
> > 21                 stack.append(fullname)
> >  6     print "- last accessed:", time.ctime(atime)
> >  7     print "- last modified:", time.ctime(mtime)
> > 22     return files
> > 
> > But it is unclear whether the intent was to be outside the while,
> > or outside the for, or part of the if.

When I cut and paste code, I know what my intent is, and I use the 
block-indent (shift-left or shift-right) features of my text editor to 
achieve that intent.

-- 
David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science




More information about the Python-list mailing list