Re: [Python-Dev] quit() on the prompt

2006-03-09 Thread Georg Brandl
Guido van Rossum wrote: We seem to have a consensus. Is anybody working on a patch yet? http://python.org/sf/1446372 Georg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] quit() on the prompt

2006-03-08 Thread Steve Holden
Oleg Broytmann wrote: On Wed, Mar 08, 2006 at 12:37:47AM +0100, Thomas Wouters wrote: Raising SystemExit(quit() called) has an additional benefit (although the wording could use some work): raise SystemExit(quit() called) quit() called (At least, I consider that a benefit :-) It has

Re: [Python-Dev] quit() on the prompt

2006-03-08 Thread Oleg Broytmann
On Wed, Mar 08, 2006 at 12:39:51PM +, Steve Holden wrote: Oleg Broytmann wrote: raise SystemExit(quit() called) quit() called Error! I should imagine the use cases for running an interactive Python shell as a part of a script are fairly few and far between, though. IDEs.

Re: [Python-Dev] quit() on the prompt

2006-03-08 Thread Neil Schemenauer
Guido van Rossum [EMAIL PROTECTED] wrote: Bad idea, as several pointed out -- quit() should return a 0 exit to the shell. I like the idea of making quit callable. One small concern I have is that people will use it in scripts to exit (rather than one of the other existing ways to exit). OTOH,

Re: [Python-Dev] quit() on the prompt

2006-03-08 Thread Ian Bicking
Neil Schemenauer wrote: Bad idea, as several pointed out -- quit() should return a 0 exit to the shell. I like the idea of making quit callable. One small concern I have is that people will use it in scripts to exit (rather than one of the other existing ways to exit). OTOH, maybe that's

Re: [Python-Dev] quit() on the prompt

2006-03-08 Thread Josiah Carlson
Ian Bicking [EMAIL PROTECTED] wrote: Neil Schemenauer wrote: Bad idea, as several pointed out -- quit() should return a 0 exit to the shell. I like the idea of making quit callable. One small concern I have is that people will use it in scripts to exit (rather than one of the

Re: [Python-Dev] quit() on the prompt

2006-03-08 Thread Greg Ewing
Oleg Broytmann wrote: IDEs. Edit a code in an editor, run python -i script.py, investigate the environment, return to the editor, get error message. An IDE is likely to want to catch SystemExits in the debugged script and handle them specially anyway. -- Greg Ewing, Computer Science Dept,

Re: [Python-Dev] quit() on the prompt

2006-03-08 Thread Guido van Rossum
We seem to have a consensus. Is anybody working on a patch yet? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

[Python-Dev] quit() on the prompt

2006-03-07 Thread Ian Bicking
Frederick suggested a change to quit/exit a while ago, so it wasn't just a string with slight instructional purpose, but actually useful. The discussion was surprisingly involved, despite the change really trully not being that big. And everyone drifted off, too tired from the discussion to

Re: [Python-Dev] quit() on the prompt

2006-03-07 Thread Guido van Rossum
Works for me. On 3/7/06, Ian Bicking [EMAIL PROTECTED] wrote: Frederick suggested a change to quit/exit a while ago, so it wasn't just a string with slight instructional purpose, but actually useful. The discussion was surprisingly involved, despite the change really trully not being that

Re: [Python-Dev] quit() on the prompt

2006-03-07 Thread Nick Coghlan
Ian Bicking wrote: class Quitter(object): def __init__(self, name): self.name = name def __repr__(self): return 'Use %s() to exit' % self.name def __call__(self): raise SystemExit() quit = Quitter('quit') exit = Quitter('exit') This is not very

Re: [Python-Dev] quit() on the prompt

2006-03-07 Thread BJörn Lindqvist
do { cmd = readline() do_stuff_with_cmd(cmd); } while (!strcmp(cmd, quit)); printf(Bye!); exit(0); KISS? -- mvh Björn ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] quit() on the prompt

2006-03-07 Thread Crutcher Dunnavant
I am probably the biggest proponent of magic variables, but this just won't work. First, commands and lines are not the same thing, so: print \ exit breaks your propossal. Second, quit and exit are bindable variables, and you need to be sure that they still mean _quit_, and not something else.

Re: [Python-Dev] quit() on the prompt

2006-03-07 Thread Ian Bicking
BJörn Lindqvist wrote: do { cmd = readline() do_stuff_with_cmd(cmd); } while (!strcmp(cmd, quit)); printf(Bye!); exit(0); KISS? I believe there were concerns that rebinding quit would cause strange behavior. E.g.: quit = False while not quit: ... quit $ Or:

Re: [Python-Dev] quit() on the prompt

2006-03-07 Thread Brett Cannon
On 3/7/06, Ian Bicking [EMAIL PROTECTED] wrote: Frederick suggested a change to quit/exit a while ago, so it wasn't just a string with slight instructional purpose, but actually useful. The discussion was surprisingly involved, despite the change really trully not being that big. And

Re: [Python-Dev] quit() on the prompt

2006-03-07 Thread Thomas Wouters
On 3/8/06, Brett Cannon [EMAIL PROTECTED] wrote: On 3/7/06, Ian Bicking [EMAIL PROTECTED] wrote: class Quitter(object):def __init__(self, name):self.name = namedef __repr__(self):return 'Use %s() to exit' % self.namedef __call__(self):raise SystemExit() quit = Quitter('quit') exit =

[Python-Dev] quit() on the prompt

2006-03-07 Thread Jim Jewett
Ian reproposed: class Quitter(object): def __init__(self, name): self.name = name def __repr__(self): return 'Use %s() to exit' % self.name def __call__(self): raise SystemExit() The one change I would suggest is the string