Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(89358)

#23699: Add a macro to ease writing rich comparisons

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 1 month ago by encukou
Modified:
3 years, 11 months ago
Reviewers:
storchaka, stefan
CC:
lemburg, barry, rhettinger, Nick Coghlan, Benjamin Peterson, encukou, skrah, storchaka, cstratak
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 15

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/c-api/typeobj.rst View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
Include/object.h View 1 2 3 4 1 chunk +18 lines, -0 lines 0 comments Download
Modules/arraymodule.c View 1 2 3 4 1 chunk +1 line, -18 lines 0 comments Download
Modules/_datetimemodule.c View 1 2 3 4 1 chunk +1 line, -17 lines 0 comments Download
Modules/parsermodule.c View 1 2 3 4 3 chunks +2 lines, -32 lines 0 comments Download
Modules/selectmodule.c View 1 2 3 4 1 chunk +1 line, -21 lines 0 comments Download
Modules/_tkinter.c View 1 2 3 4 3 chunks +2 lines, -32 lines 0 comments Download
Objects/bytearrayobject.c View 1 2 3 4 2 chunks +11 lines, -26 lines 0 comments Download
Objects/bytesobject.c View 1 2 3 4 5 chunks +7 lines, -20 lines 0 comments Download
Objects/cellobject.c View 1 2 3 4 2 chunks +2 lines, -34 lines 0 comments Download
Objects/descrobject.c View 1 2 3 4 2 chunks +2 lines, -33 lines 0 comments Download
Objects/listobject.c View 1 2 3 4 2 chunks +5 lines, -28 lines 0 comments Download
Objects/longobject.c View 1 2 3 4 1 chunk +1 line, -30 lines 0 comments Download
Objects/tupleobject.c View 1 2 3 4 1 chunk +3 lines, -21 lines 0 comments Download

Messages

Total messages: 5
storchaka_gmail.com
http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c File Modules/_decimal/_decimal.c (right): http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c#newcode4300 Modules/_decimal/_decimal.c:4300: return (op == Py_NE) ? incr_true() : incr_false(); return ...
4 years, 1 month ago #1
skrah
http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c File Modules/_decimal/_decimal.c (right): http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c#newcode4300 Modules/_decimal/_decimal.c:4300: return (op == Py_NE) ? incr_true() : incr_false(); On ...
4 years, 1 month ago #2
storchaka_gmail.com
http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c File Modules/_decimal/_decimal.c (right): http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c#newcode4300 Modules/_decimal/_decimal.c:4300: return (op == Py_NE) ? incr_true() : incr_false(); On ...
4 years, 1 month ago #3
skrah
http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c File Modules/_decimal/_decimal.c (right): http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c#newcode4300 Modules/_decimal/_decimal.c:4300: return (op == Py_NE) ? incr_true() : incr_false(); > ...
4 years, 1 month ago #4
storchaka_gmail.com
4 years, 1 month ago #5
http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c
File Modules/_decimal/_decimal.c (right):

http://bugs.python.org/review/23699/diff/14233/Modules/_decimal/_decimal.c#ne...
Modules/_decimal/_decimal.c:4300: return (op == Py_NE) ? incr_true() :
incr_false();
On 2015/03/19 12:37:52, skrah wrote:
> > What incr_true() and incr_false() do, why they are used instead of one of
> idiomatic codes?
> 
> Because at some point Amaury requested that Py_INCREF() should not be used in
an
> expression like (Py_INCREF(t), t). I think it was related to PyPy.
> 
> Also, I like the ternary operator because it breaks the monotony of reading
the
> same patterns over and over again, so I'm not going to change this.

It is good to me if it is good for you.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+