Author lemburg
Recipients barry, ethan.furman, lemburg, petr.viktorin, rhettinger, serhiy.storchaka, skrah
Date 2015-05-18.14:04:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <5559F167.9080609@egenix.com>
In-reply-to <1431956769.79.0.255704514668.issue23699@psf.upfronthosting.co.za>
Content
On 18.05.2015 15:46, Stefan Krah wrote:
> 
> Stefan Krah added the comment:
> 
> The problem with this macro is that most of the time it takes the
> standard cmp return value {-1,0,1} and converts that into a bool.
> 
> For this use case, it might be more appropriate to use a
> static inline function Py_cmp_to_bool().
> 
> To put it differently, the macro mostly does not perform the
> actual rich comparison but just post-processes the result.
> 
> 
> I don't like the dual use of converting cmp() return values
> and performing actual comparisons on integers, so -1 on
> the concept.

I don't follow you. The macro performs a similar task as
that of e.g. Py_RETURN_TRUE/Py_RETURN_FALSE/etc. that is
to reduce boilerplate code and in this particular case
also to remove potential sources of bugs in both the Python
interpreter itself and C extensions written for it.
History
Date User Action Args
2015-05-18 14:04:27lemburgsetrecipients: + lemburg, barry, rhettinger, petr.viktorin, skrah, ethan.furman, serhiy.storchaka
2015-05-18 14:04:27lemburglinkissue23699 messages
2015-05-18 14:04:27lemburgcreate