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>



_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to