[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()

Taylor Alexander report at bugs.python.org
Mon Jul 12 05:52:07 EDT 2021


Taylor Alexander <tlalexander at gmail.com> added the comment:

Hello all. Curious issue. Thanks Stargirl for opening it.

Would it be possible for the __repr__ function to examine the calling commands and determine if the origin is the special case where exit is typed in the REPL? Then only when Quitter repr is called would the special case be checked. I’m not too familiar with Python internals but I know for example when an exception occurs a stack trace would include information like that. Probably performance of Quitter repr isn’t critical we just don’t want it to have the wrong behavior. But if there’s any way to determine in that call if we’re in this one special case it seems it would be safe to exit.

----------
nosy: +tlalexander

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44603>
_______________________________________


More information about the Python-bugs-list mailing list