This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cben
Recipients belopolsky, cben, eric.araujo, lesmana, loewis, ned.deily, pitrou, r.david.murray, ronaldoussoren
Date 2011-09-06.16:05:05
SpamBayes Score 2.7703229e-11
Marked as misclassified No
Message-id <1315325106.0.0.199487987908.issue5845@psf.upfronthosting.co.za>
In-reply-to
Content
[sorry, html mail was bad idea]

On Tue, Sep 6, 2011 at 17:54, Antoine Pitrou <report@bugs.python.org> wrote:

Éric Araujo <merwok@netwok.org> added the comment:
> > It's more useful to have a hook called when entering interactive mode,
> > rather than a flag
> > that's set from the beginning:
> We already have such a hook: $PYTHONSTARTUP

Good point!
It covers the user's desire customization very well (esp. if it worked with -i).
sys.__interactivehook__ has the benefit of being cleanly settable from python code.
But it might well be a YAGNI idea.

> $PYTHONSTARTUP doesn't work with -i
 
Perhaps it should?
I can't think of a thing that makes sense in $PYTHONSTARTUP that I wouldn't want with -i.
(and if there is one, one can add a test for sys.flags.interactive, or run with env PYTHONSTARTUP='')
 
Point to watch out for: errors in $PYTHONSTARTUP.
One of the uses of "python -i script.py" is doing pdb.pm() on an exception thrown by the script;
ideally a broken $PYTHONSTARTUP would not overr

> > BTW, drawback of doing any such setup in site.py: "python -S" 
> > would be unfriendly!
> People using -S don’t want the customizations done in site, so I 
> don’t think there’s a problem here.

python -S doesn't disable readline.  What makes completions more of a "customization" than editing?
The fact that it'd be implemented in site.py?
Yes, obviously, if it's implemented in site.py, -S should disable it.  My point was that it doesn't have to be implemented there.  You could drink the cool aid instead :-)
History
Date User Action Args
2011-09-06 16:05:06cbensetrecipients: + cben, loewis, ronaldoussoren, belopolsky, pitrou, ned.deily, eric.araujo, r.david.murray, lesmana
2011-09-06 16:05:05cbensetmessageid: <1315325106.0.0.199487987908.issue5845@psf.upfronthosting.co.za>
2011-09-06 16:05:05cbenlinkissue5845 messages
2011-09-06 16:05:05cbencreate