[issue29986] Documentation recommends raising TypeError from tp_richcompare

2020-10-20 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2020-10-03 Thread Irit Katriel
Irit Katriel added the comment: Looks like this issue can be closed. -- nosy: +iritkatriel ___ Python tracker ___ ___

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2019-09-13 Thread miss-islington
miss-islington added the comment: New changeset 4556b1d35c352c975f3cf066362cb6e24efe0668 by Miss Islington (bot) in branch '3.8': bpo-29986: Doc: Delete tip to raise TypeError from tp_richcompare. (GH-16095) https://github.com/python/cpython/commit/4556b1d35c352c975f3cf066362cb6e24efe0668

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2019-09-13 Thread Julien Palard
Julien Palard added the comment: New changeset 375a3e2bdbeb4dce69aba4b5bc90f55fe27e81b4 by Julien Palard in branch 'master': bpo-29986: Doc: Delete tip to raise TypeError from tp_richcompare. (GH-16095) https://github.com/python/cpython/commit/375a3e2bdbeb4dce69aba4b5bc90f55fe27e81b4

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2019-09-13 Thread miss-islington
Change by miss-islington : -- pull_requests: +15717 pull_request: https://github.com/python/cpython/pull/16097 ___ Python tracker ___

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2019-09-13 Thread Julien Palard
Change by Julien Palard : -- keywords: +patch pull_requests: +15716 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16095 ___ Python tracker ___

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2019-03-27 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: The consensus is clearly to return NotImplemented in this case, also because that's what most builtins do, like the object() example that you mentioned. However, I would rather keep that note and change it to say return NotImplemented. It's an important

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2017-04-04 Thread Devin Jeanpierre
Devin Jeanpierre added the comment: Yeah, I agree there might be a use-case (can't find one offhand, but in principle), but I think it's rare enough that you're more likely to be led astray from reading this note -- almost always, NotImplemented does what you want. In a way this is a special

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2017-04-04 Thread R. David Murray
R. David Murray added the comment: The documentation is technically correct, as far as I can see. Issue 8743 is not about disallowing certain comparison operations, but rather incorrectly implementing the earlier sentence in that same doc section: "If the comparison is undefined, it must

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2017-04-04 Thread Devin Jeanpierre
Devin Jeanpierre added the comment: Sorry, forgot to link to docs because I was copy-pasting from the PR: https://docs.python.org/2/c-api/typeobj.html#c.PyTypeObject.tp_richcompare https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_richcompare > Note: If you want to implement a

[issue29986] Documentation recommends raising TypeError from tp_richcompare

2017-04-04 Thread Devin Jeanpierre
New submission from Devin Jeanpierre: am not sure when TypeError is the right choice. Definitely, most of the time I've seen it done, it causes trouble, and NotImplemented usually does something better. For example, see the work in https://bugs.python.org/issue8743 to get set to interoperate