Author cben
Recipients belopolsky, cben, eric.araujo, lesmana, loewis, ned.deily, pitrou, r.david.murray, ronaldoussoren
Date 2011-09-05.18:29:38
SpamBayes Score 1.33505e-07
Marked as misclassified No
Message-id <1315247379.39.0.723748019545.issue5845@psf.upfronthosting.co.za>
In-reply-to
Content
Easily detecting interactive mode is of general interest for customization.

1. What if C also set sys.flags.interactive in "python" mode,
   or exposed sys.flags.implicit_interactive (but with better name)?

2. It's more useful to have a hook called when entering interactive mode,
   rather than a flag that's set from the beginning:

   $ python -i -c 'import sys; print sys.flags.interactive'
   1
   >>> 

   For this, importing _setupinteractive is a step forward;
   calling e.g. sys.__interactivehook__ sounds even better.
   (site.py would set it by default to a function that enables
   rlcompleter, user can always override...)

BTW, drawback of doing any such setup in site.py: "python -S" would 
be unfriendly!
History
Date User Action Args
2011-09-05 18:29:39cbensetrecipients: + cben, loewis, ronaldoussoren, belopolsky, pitrou, ned.deily, eric.araujo, r.david.murray, lesmana
2011-09-05 18:29:39cbensetmessageid: <1315247379.39.0.723748019545.issue5845@psf.upfronthosting.co.za>
2011-09-05 18:29:38cbenlinkissue5845 messages
2011-09-05 18:29:38cbencreate