Grouping code by indentation - feature or ******?

Tim Roberts timr at probo.com
Wed Mar 30 08:48:50 CEST 2005


"Terry Reedy" <tjreedy at udel.edu> wrote:

>
>"Antoon Pardon" <apardon at forel.vub.ac.be> wrote in message 
>news:slrnd4i20o.20i.apardon at rcpc42.vub.ac.be...
>> 1) The stuff doesn't has to be spread over multiple pages. One
>>   can have 2 functions, each about three quarter of a page.
>>   The second function will then cross a page boundary.
>
>Once upon a time, one could put a literal ASCII pagefeed char (^L I 
>believe) in a comment between the two functions to put each on its own 
>page.  I have not tried this on Windows, though.

In many languages, C and Python included, the formfeed (^L) is just another
piece of whitespace.  You don't even need to comment it.

  C:\Tmp>type x.py
  print "before"
  ^L
  print "after"

  C:\Tmp>x.py
  before
  after

  C:\Tmp>

(Pedantic note: I cheated there.  My cmd session did not really say "^L".
It gave me the symbol for female, which is code point 12 in the default
character set.  I translated it to the VIM equivalent to make the point.)
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list