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.

Author jon
Recipients jon
Date 2009-09-27.00:04:56
SpamBayes Score 9.009618e-06
Marked as misclassified No
Message-id <1254009899.52.0.128079117198.issue7004@psf.upfronthosting.co.za>
In-reply-to
Content
I've sometimes found it useful to define a convenience macro named
Py_RETURN_BOOL(x) which is essentially:

#define Py_RETURN_BOOL(x) if (x) Py_RETURN_TRUE; else Py_RETURN_FALSE

It's useful for implementing functions which return Boolean values based
on simple conditions.

I think it's readable and doesn't detract from regular program flow,
although it does hide the condition behind a macro, which detracts a bit
from the code's debug-ability.
History
Date User Action Args
2009-09-27 00:05:00jonsetrecipients: + jon
2009-09-27 00:04:59jonsetmessageid: <1254009899.52.0.128079117198.issue7004@psf.upfronthosting.co.za>
2009-09-27 00:04:58jonlinkissue7004 messages
2009-09-27 00:04:57joncreate