A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-December/059167.html below:

[Python-Dev] a quit that actually quits

[Python-Dev] a quit that actually quits [Python-Dev] a quit that actually quitsFredrik Lundh fredrik at pythonware.com
Wed Dec 28 11:04:55 CET 2005
Martin v. Löwis wrote:

> > In short, I think it makes a lot of sense to support a bare "exit" and/or
> > "quit" as a completely intuitive platform-independent newbie-friendly way to
> > exit the interpreter.
>
> I can readily agree to this part of Fredrik's proposal. What slightly
> bothers me is the hackish nature of the proposed implementation.

here's my current proposal (see ping's post and my reply for background):

    if isinstance(exc_value, NameError) and not exc_info.tb_next:
        text = exc_value[0]
        name = ... extract name from nameerror string ...
        if sys.commandline.strip() == name:
            if name in ("exit", "quit"):
                raise SystemExit
            if name == "help":
                help()
                return
    ...

any suggestions on how to improve this ?

</F>



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4