[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()
Change by Stargirl Flowers : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue44603> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()
Stargirl Flowers added the comment: @steven.daprano I appreciate your perspective but you laid out a lot of strong opinions as if they're incontrovertible truths. The motivation here isn't laziness- I created this bug because I saw actual people across various skill levels that are bugged by this behavior. I don't think that I can accept your declaration that changing this behavior would be user hostile in the face of multiple pieces of user feedback that says the existing behavior is hostile and changing it would be an improvement. It's not about saving two characters. It's about doing what the user actual means and expects- based on feedback it seems that almost everyone expects "exit" to exit. Your point about being able to inspect objects falls a bit flat when the current behavior is: >>> exit Use exit() or Ctrl-D (i.e. EOF) to exit If I weren't an experienced Python developer, I would have no idea that "exit" is actually an object and its __repr__ is what's showing there. To those who haven't ascended to language experts, this just seems like the program chiding us - like responding to "can I have some water" with "*may* you have some water". I didn't type "exit" to view the exit object, I typed it to leave the interpreter. If I *do* want to inspect it, well, there's dir() and help(), which are far, far more useful than the __repr__. -- ___ Python tracker <https://bugs.python.org/issue44603> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()
Stargirl Flowers added the comment: Fair point about semantic behavior and complexity, but hopefully we can come up with a solution that's easier for users. I do like the PR suggested. -- ___ Python tracker <https://bugs.python.org/issue44603> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()
Stargirl Flowers added the comment: I do want to be cautious of saying that we can't do it because of the way the REPL is currently implemented- which appears to be an implementation driven by convenience more than necessity. I also find pushing against special-case behavior in the REPL strange. The REPL already has special-case behavior: printing the header, the __interactivehook__ that configures readline, heck, the `>>>` are unique the REPL and plainly copy-pasting a REPL session into a file won't work. -- ___ Python tracker <https://bugs.python.org/issue44603> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()
Stargirl Flowers added the comment: Also, if a PEP is recommended, I will be happy to author it. -- ___ Python tracker <https://bugs.python.org/issue44603> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()
Stargirl Flowers added the comment: I don't think we should completely write off the possibility of doing this just because the *current* implementation is counter-intuitive. As I expressed in the original post, the explanation of this behavior is rather unsatisfying to newcomers. Also @steven.daprano, please do not confuse one recommendation for implementation for the concept. I agree that printing the Quitter object should not exit the interpreter. However, I disagree that "exit" should not be a special case. Specifically, when using the interactive interpreter the behavior (regardless of implementation strategy) would ideally be: >>> exit (interpreter exit) >>> exit() (interpreter exit) >>> print(exit) Call "exit()" to quit Python. When using the interactive interpreter you can simply type "exit". This behavior closely matches IPython's behavior, and even a cursory search reveals not only individual users running into this and being frustrated, but even threads where this behavior has reached "meme status": https://twitter.com/0xabad1dea/status/1414204661360472065?s=19 -- ___ Python tracker <https://bugs.python.org/issue44603> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit()
New submission from Stargirl Flowers : Presently, when using REPL if a user types simply "exit", they are greeted with a message instructing them to do it "correctly": >>> exit Use exit() or Ctrl-Z plus Return to exit It comes across as a little surprising that (1) the program knows what I meant and (2) the program told me it wouldn't do it unless I request it in a very specific way. This isn't very user-friendly behavior. Further surprising is the inconsistent behavior of the other built-ins described on interpreter start-up. "copyright" and "credits" work fine without being invoked as a function, whereas "help" and "license" rebuff the user. I know there are compelling technical reasons for the current behavior, however, this behavior is a bit off-putting for newcomers. Knowing the technical reasons behind this behavior made me *more* frustrated than less frustrated. Python is a lovely language and I think we should do what we can to be friendlier to users. I propose a few changes to fix this specific issue: (1) Include "exit" in the interpreter startup message, making it: Type "help", "copyright", "credits" or "license" for more information, and type "exit" to quit Python. (2) Make the interactive interpreter exit when the user types simply "exit" or "quit. To address some possible edge cases an objections: - if (2) proves too controversial, we should at least do (1) with the slight modification of "exit" to "exit()". - if there is a concern about accidentally exiting the interpreter, there are several strategies we can use. First, we can only activate this behavior if, and only if, Python is being used as an interactive interpreter. From what I can tell, main() is already distinguishing this case. Second, if absolutely necessary we could ask the user to confirm that they want to exit. For example: >>> exit Are you sure you want to exit Python? (yes/no): For what it's worth, I am willing to do this work, however, I might need a little guidance to find the right bits. -- components: Demos and Tools messages: 397273 nosy: theacodes priority: normal severity: normal status: open title: REPL: exit when the user types exit instead of asking them to explicitly type exit() ___ Python tracker <https://bugs.python.org/issue44603> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41946] Add concrete examples to os.path documentation
New submission from Stargirl Flowers : Presently the documentation for os.path (https://docs.python.org/3.8/library/os.path.html) doesn't contain any concrete examples of the input and outputs of the various path manipulation functions. Contrast this to the Node.js documentation for similar functionality (https://nodejs.org/api/path.html) We could add replesque examples such as: >> os.path.abspath("example.py") "/full/path/to/example.py" ... >> os.path.basename("example.py") "example" & so on. I believe it would be useful for us to have concrete examples here and I'm happy to contribute this. If anyone feels differently, let me know. -- assignee: docs@python components: Documentation messages: 378043 nosy: docs@python, theacodes priority: normal severity: normal status: open title: Add concrete examples to os.path documentation type: enhancement ___ Python tracker <https://bugs.python.org/issue41946> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com