Why sys.ps2 after interactive #-line?

Tim Daneliuk tundra at tundraware.com
Sun Jun 24 19:10:01 EDT 2001


Michael Hudson wrote:
> 
> bokr at accessone.com (Bengt Richter) writes:
> 
> >  >>>
> >  >>> # comment
> >  ... # why ... at beginning of this line?
> >  ... # and this, and the next?
> >  ...
> >  >>>
> >
> > Why not a fresh sys.ps1 prompt after each #-line ?
> 
> Because That's The Way It Is.  The heuristics the Python prompt uses
> to decide whether a statement typed interactively is finished are a
> bit hairy.  They seem to work most of the time though.
> 
> > Just curious :)
> 
> Well, if you're *really* curious, you should probably read the
> source...
> 
> Cheers,
> M.
> 
> --
> 41. Some programming languages manage to absorb change, but
>     withstand progress.
>   -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html

Incidentally, IDLE does NOT do this...
-- 
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com



More information about the Python-list mailing list