[issue5845] rlcompleter should be enabled automatically

Cherniavsky Beni report at bugs.python.org
Tue Sep 6 17:54:27 CEST 2011


Cherniavsky Beni <beni at google.com> added the comment:

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

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

"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 :-)

----------
Added file: http://bugs.python.org/file23108/unnamed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5845>
_______________________________________
-------------- next part --------------
<div class="gmail_quote">On Tue, Sep 6, 2011 at 17:54, Antoine Pitrou <span dir="ltr">&lt;<a href="mailto:report at bugs.python.org" target="_blank">report at bugs.python.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><br><span style="color:rgb(34, 34, 34);font-family:arial, sans-serif;font-size:14px">��ric Araujo &lt;<a href="mailto:merwok at netwok.org" style="color:rgb(17, 85, 204)" target="_blank">merwok at netwok.org</a>&gt; added the comment:<br>


</span>
</div><div>&gt; &gt; It&#39;s more useful to have a hook called when entering interactive mode, rather than a flag<br>
&gt; &gt; that&#39;s set from the beginning:<br>
&gt; We already have such a hook: $PYTHONSTARTUP<br>
<br></div></blockquote><div>Good point!</div><div>It covers the user&#39;s desire customization very well (esp. if it worked with -i).</div><div>sys.__interactivehook__ has the benefit of being cleanly settable from python code.</div>

<div>But it might well be a YAGNI idea.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>

</div>$PYTHONSTARTUP doesn&#39;t work with -i<br></blockquote><div>��</div><div>Perhaps it should?</div><div>I can&#39;t think of a thing that makes sense in $PYTHONSTARTUP that I wouldn&#39;t want with -i.</div><div>(and if there is one, one can add a test for��sys.flags.interactive, or run with env PYTHONSTARTUP=&#39;&#39;)</div>


<div>��</div><div>Point to watch out for: errors in $PYTHONSTARTUP.</div><div>One of the uses of &quot;python -i script.py&quot; is doing <a href="http://pdb.pm">pdb.pm</a>() on an exception thrown by the script;</div><div>

ideally a broken $PYTHONSTARTUP would not overr</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div>&gt; BTW, drawback of doing any such setup in site.py: &quot;python -S&quot; would be unfriendly!People using -S don���t want the customizations done in site, so I don���t think there���s a problem here.</div>


<div><br></div></div></div></blockquote><div>python -S doesn&#39;t disable readline. ��What makes completions more of a &quot;customization&quot; than editing?</div><div>The fact that it&#39;d be implemented in site.py?</div>


<div>Yes, obviously, if it&#39;s implemented in site.py, -S should disable it. ��My point was that it doesn&#39;t have to be implemented there. ��You could drink the cool aid instead :-)</div></div>


More information about the Python-bugs-list mailing list