[issue37934] Docs: Clarify NotImplemented use cases

2019-09-05 Thread Vedran Čačić
Vedran Čačić added the comment: Of course, if there are independent use cases already in the codebase, then my opinion is changed. -- ___ Python tracker ___

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-05 Thread Kyle Stanley
Kyle Stanley added the comment: > As you say, we currently have only one usage of NotImplemented outside its > intended purpose. Maybe we should wait to see whether it becomes at least a > little bit more popular, before thinking about blessing it. > I know at least 3 in CPython, so it's

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-04 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > As you say, we currently have only one usage of NotImplemented outside its > intended purpose. I know at least 3 in CPython, so it's not so rare to use NotImplemented for something else than binary operators: 1. __subclasshook__ 2. reducer_override (in

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-02 Thread Vedran Čačić
Vedran Čačić added the comment: Of course, languages evolve. Annotations were introduced just for function arguments, now we use them almost everywhere. Generators were simply loop managers, now they've blown up to complete asynchronous programming beasts. Ellipsis was introduced for easier

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-02 Thread Kyle Stanley
Kyle Stanley added the comment: Thanks for the explanation. > Of course, you might argue that _once Python has NotImplemented_, it can be > used elsewhere - but as I said, I don't think it should be encouraged. Hmm, okay. My understanding of Raymond's explanation was more so "let's not

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-02 Thread Vedran Čačić
Vedran Čačić added the comment: Sorry, I think you still don't understand. The emulation of double dispatch by single dispatch, with all complications it brings, is the only reason NotImplemented exists. If Python didn't have binary operators (or inheritance), I'm quite sure it wouldn't have

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-01 Thread Kyle Stanley
Kyle Stanley added the comment: > Would it be viable to rephrase the existing section in a manner that explains > the functional purpose of NotImplemented without revolving around its use > case in binary special methods? To expand further upon this, here's an initial idea for improving the

[issue37934] Docs: Clarify NotImplemented use cases

2019-09-01 Thread Kyle Stanley
Kyle Stanley added the comment: Thanks for the feedback Vedran and Raymond. > It is not the purpose of the docs to list use cases. Mostly we say what > something does or how it is defined. As Vedran says, how people use it is > their own business. The underlying issue here seems to be

[issue37934] Docs: Clarify NotImplemented use cases

2019-08-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: It is not the purpose of the docs to list use cases. Mostly we say what something does or how it is defined. As Vedran says, how people use it is their own business. Also, please be careful expanded the docs. They quickly become a promise. Per

[issue37934] Docs: Clarify NotImplemented use cases

2019-08-25 Thread Vedran Čačić
Vedran Čačić added the comment: Well, it is the _intended_ use of NotImplemented. Of course you can use it whenever you want, just as you can use Ellipsis whenever you want. But I don't think docs should encourage that. -- nosy: +veky ___ Python

[issue37934] Docs: Clarify NotImplemented use cases

2019-08-24 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- nosy: +jdemeyer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37934] Docs: Clarify NotImplemented use cases

2019-08-23 Thread Kyle Stanley
New submission from Kyle Stanley : In the documentation for the NotImplemented constant (https://docs.python.org/3/library/constants.html#NotImplemented), the only use case mentioned is for binary special methods, (such as object.__eq__(other)). However, based on a conversation in a recent