Re: [Python-Dev] a quit that actually quits
The F-bot writes:
in reality, some things are carefully thought out and craftily im- plemented, some things are engineering tradeoffs made at a certain time, and some things are just accidents -- but python-dev will happily defend the current solution with the same energy, no matter what it is.
+1 QOTF. Seriously... I've seen this behavior also, but I haven't ever thought about it as clearly as Fredrik does here. When we go to answer questions we ought to pause briefly first and decide which of these categories applies to a given piece of behavior. I think users will be understanding if we're honest about what are the accidents -- every language or software package has some, and just because it's an accident does NOT mean we should "fix" it. -- Michael Chermside
Michael Chermside wrote:
Seriously... I've seen this behavior also, but I haven't ever thought about it as clearly as Fredrik does here. When we go to answer questions we ought to pause briefly first and decide which of these categories applies to a given piece of behavior. I think users will be understanding if we're honest about what are the accidents -- every language or software package has some, and just because it's an accident does NOT mean we should "fix" it.
But we do that (atleast I do): when I believe something is wrong, I don't argue it is right; instead, I ask for a contribution of fixes. I do argue it is right when I believe it is right. Regards, Martin
Michael Chermside wrote:
The F-bot writes:
in reality, some things are carefully thought out and craftily im- plemented, some things are engineering tradeoffs made at a certain time, and some things are just accidents -- but python-dev will happily defend the current solution with the same energy, no matter what it is.
+1 QOTF.
Seriously... I've seen this behavior also, but I haven't ever thought about it as clearly as Fredrik does here. When we go to answer questions we ought to pause briefly first and decide which of these categories applies to a given piece of behavior. I think users will be understanding if we're honest about what are the accidents -- every language or software package has some, and just because it's an accident does NOT mean we should "fix" it.
it's indeed a matter of trade-offs. Converting NameErrors into commands doesn't look like a good trade off in terms of expectations management and understandable behavior. Ka-Ping Yee ExitHatch still seem a reasonable improvement. Fernando Perez considerations about Python vs. "commands" and prefixing and extra-linguistic extensions seem also on spot. It's not a matter of defending the status quo, more about what kind of price is reasonable for DWIM.
Samuele Pedroni wrote:
Michael Chermside wrote:
The F-bot writes:
in reality, some things are carefully thought out and craftily im- plemented, some things are engineering tradeoffs made at a certain time, and some things are just accidents -- but python-dev will happily defend the current solution with the same energy, no matter what it is.
+1 QOTF.
Seriously... I've seen this behavior also, but I haven't ever thought about it as clearly as Fredrik does here. When we go to answer questions we ought to pause briefly first and decide which of these categories applies to a given piece of behavior. I think users will be understanding if we're honest about what are the accidents -- every language or software package has some, and just because it's an accident does NOT mean we should "fix" it.
Most of the times I've asked questions along these lines I've gotten well-considered answers (usually because something I thought was a deliberate design decision on Guido's part turned out to simply be an accident of the way it happened to be implemented in CPython).
it's indeed a matter of trade-offs. Converting NameErrors into commands doesn't look like a good trade off in terms of expectations management and understandable behavior. Ka-Ping Yee ExitHatch still seem a reasonable improvement. Fernando Perez considerations about Python vs. "commands" and prefixing and extra-linguistic extensions seem also on spot. It's not a matter of defending the status quo, more about what kind of price is reasonable for DWIM.
I think Fredrik has made an excellent case for promoting the quit & exit
interpreter-only builtins to be proper callables.
Hell, we even have that capability for the callable that displays the
*license* text. . . surely quitting the interpreter is far more important than
being able to display the license text, but the support for the latter is
significantly better:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Py> exit
'Use Ctrl-Z plus Return to exit.'
Py> quit
'Use Ctrl-Z plus Return to exit.'
Py> license
Type license() to see the full license text
Py> type(license)
"Nick" == Nick Coghlan
writes:
Nick> Samuele Pedroni wrote: >> It's not a matter of defending the status quo, more about what >> kind of price is reasonable for DWIM. IMHO, +N*10^6 for simplicity, regularity, and discoverability, -1 for DWIM in the interpreter. DWIM is for wrappers, interactive tutorials, and IDEs. Nick> I think Fredrik has made an excellent case for promoting the Nick> quit & exit interpreter-only builtins to be proper Nick> callables. No, Fredrik has made a good (but not good enough!) case for making them syntax (or for adding the concept of "interpreter command" to the specification), but your own example of "license" works against you for callables: Nick> Hell, we even have that capability for the callable that Nick> displays the *license* text. . . surely quitting the Nick> interpreter is far more important than being able to display Nick> the license text, but the support for the latter is Nick> significantly better: Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. Py> license Type license() to see the full license text Py> Now, unlike the case of quit, where the user did something undocumented (albeit "natural") that really is rude (and its semantics are no "better" than the support for quit). (Example edited to enhance the effect.) I do think it's reasonable that those callables be somewhat python-newbie-friendly. What I would want to see is papa% python Python 2.4.2 (#1, Dec 23 2005, 01:55:50) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help()", "copyright()", "credits()" or "license()" for more information. Type EOF (Ctrl-D) to end the interpreter session.
help Type "help()". In Python, work is done by function calls, not statements or commands. This message is the printable representation of the help object. help() You may exit the interpreter with an EOF (Ctrl-D), or by calling a system function or raising an appropriate exception. [ ... etc, etc, ... ]
copyright, credits, license, quit, and exit would be treated similarly (except maybe they should not be quite so "educational," just the brief reminder 'Type "<callable>()". Type "help()" for help.' should be enough). I definitely don't think help() should advertise exit(), as it is too similar to sys.exit(). I'm -1 on quit() being advertised because I'm -1 on DWIM in principle, but if DWIM is accepted for this purpose, I don't see practical harm in advertising it. IMO, in the end making "quit" callable really isn't responsive to Fredrik's point. Which is AIUI that most interactive shells do have a quit command, and newbies are going to expect Python to have one, too. -- School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.
Nick Coghlan wrote:
Samuele Pedroni wrote:
Michael Chermside wrote:
The F-bot writes:
in reality, some things are carefully thought out and craftily im- plemented, some things are engineering tradeoffs made at a certain time, and some things are just accidents -- but python-dev will happily defend the current solution with the same energy, no matter what it is.
+1 QOTF.
Seriously... I've seen this behavior also, but I haven't ever thought about it as clearly as Fredrik does here. When we go to answer questions we ought to pause briefly first and decide which of these categories applies to a given piece of behavior. I think users will be understanding if we're honest about what are the accidents -- every language or software package has some, and just because it's an accident does NOT mean we should "fix" it.
Most of the times I've asked questions along these lines I've gotten well-considered answers (usually because something I thought was a deliberate design decision on Guido's part turned out to simply be an accident of the way it happened to be implemented in CPython).
it's indeed a matter of trade-offs. Converting NameErrors into commands doesn't look like a good trade off in terms of expectations management and understandable behavior. Ka-Ping Yee ExitHatch still seem a reasonable improvement. Fernando Perez considerations about Python vs. "commands" and prefixing and extra-linguistic extensions seem also on spot. It's not a matter of defending the status quo, more about what kind of price is reasonable for DWIM.
I think Fredrik has made an excellent case for promoting the quit & exit interpreter-only builtins to be proper callables.
notice that I wrote that Ka-Ping Yee ExitHatch is an improvement!
Hell, we even have that capability for the callable that displays the *license* text. . . surely quitting the interpreter is far more important than being able to display the license text, but the support for the latter is significantly better:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. Py> exit 'Use Ctrl-Z plus Return to exit.' Py> quit 'Use Ctrl-Z plus Return to exit.' Py> license Type license() to see the full license text Py> type(license)
Counting blank lines, 60 lines of site.py are devoted to getting copyright, credit and license to work right, 16 to getting help to work, and only 12 to setting quit and exit to the 'right' strings - and due to modules like readline for Windows and differences in the way interpreters buffer the line input, the exit string for Windows is not always correct.
Cheers, Nick.
participants (5)
-
"Martin v. Löwis"
-
Michael Chermside
-
Nick Coghlan
-
Samuele Pedroni
-
Stephen J. Turnbull