homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Format of TypeError differs between comparison and arithmetic operators
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: MLModel, berker.peksag, gennad, ncoghlan, r.david.murray
Priority: normal Keywords: patch

Created on 2013年12月27日 01:16 by MLModel, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
20077.patch gennad, 2013年12月27日 22:38 review
Messages (5)
msg206977 - (view) Author: Mitchell Model (MLModel) Date: 2013年12月27日 01:16
[ctypes correct component for this?]
The TypeError messages given for incompatible types in comparison operators differ from incompatible types in arithmetic operators. The arithmetic operator error messages show the names of the types in single quotes, while the comparison error messages do not use quotes but follow the name of the type with a pair of parens. Seems like these should be analogous.
 class foo(): pass
... 
>>> foo() + 1
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'foo' and 'int'
>>> foo() < 1
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
TypeError: unorderable types: foo() < int()
msg207013 - (view) Author: Gennadiy Zlobin (gennad) * Date: 2013年12月27日 22:38
I created a patch for it, please review
msg207133 - (view) Author: Mitchell Model (MLModel) Date: 2014年01月01日 14:02
Patch looks good to me. I like the choice to drop the parens. This is my first time reviewing a change; did I go through the right mechanics? I clicked Review on the issue's patch, looked at the diff, and a published a message similar to this one. Was I supposed to do something else? Is that message what "Review" is looking for? Was the "Please review" directed at me? Am I supposed to make a comment like "looks good" here? do something else?
msg216079 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014年04月14日 13:52
I think 'please review' was directed at anyone, and yes, using the review link is one way to do a review, but when there isn't enough line-by-line commenting to make the code review tool worth using you can just post on the issue. (And when you do use the review link, it is helpful to post a message here that you did, since one doesn't appear automatically...which is something we need to fix.)
msg264036 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016年04月23日 01:52
The exception message has been updated to "TypeError: '<' not supported between instances of 'Color' and 'Color'" in 0238eafb68da. Closing this as 'out of date'.
History
Date User Action Args
2022年04月11日 14:57:55adminsetgithub: 64276
2016年04月23日 01:52:40berker.peksagsetstatus: open -> closed

nosy: + berker.peksag
messages: + msg264036

resolution: out of date
stage: resolved
2014年04月14日 13:52:40r.david.murraysetnosy: + r.david.murray
messages: + msg216079
2014年01月01日 14:02:30MLModelsetmessages: + msg207133
2013年12月27日 22:38:14gennadsetfiles: + 20077.patch

nosy: + gennad
messages: + msg207013

keywords: + patch
2013年12月27日 22:29:13eric.araujosetnosy: + ncoghlan

components: + Interpreter Core, - ctypes
versions: + Python 3.5, - Python 3.3, Python 3.4
2013年12月27日 01:16:10MLModelcreate

AltStyle によって変換されたページ (->オリジナル) /