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 vstinner
Recipients christian.heimes, gregory.p.smith, mark.dickinson, pernici, vstinner
Date 2009-03-26.23:57:53
SpamBayes Score 2.728484e-12
Marked as misclassified No
Message-id <1238111879.24.0.444942566073.issue4294@psf.upfronthosting.co.za>
In-reply-to
Content
> I think PyLong_SIGN and PyLong_EQUALS_ZERO should go in
> Include/longobject.h, not Include/longintrepr.h

Yeah, it's better for 3rd party modules.

> PyLong_NDIGITS should stay in longintrepr.h, though,
> since it's dependent on the representation.

I don't understand why. PyLong_SIGN() and PyLong_EQUALS_ZERO() do also 
depend on the PyLong implementation. Eg. if we choose to store zero in 
a PyLong of 1 digit (digits={0}), PyLong_SIGN() have also to be 
changed. I think that PyLong_SIGN() can also be moved to longobject.h 
(not done in my patch v3).

> Perhaps rename PyLong_EQUALS_ZERO to PyLong_IS_ZERO?

Done.

> Almost all your uses of PyLong_SIGN take the form 
> PyLong_SIGN(X) < 0. Maybe it would be better to have a
> PyLong_IS_NEGATIVE macro instead?

Not "almost all", just "all" :-) So I also changed the macro name.
History
Date User Action Args
2009-03-26 23:58:00vstinnersetrecipients: + vstinner, gregory.p.smith, mark.dickinson, pernici, christian.heimes
2009-03-26 23:57:59vstinnersetmessageid: <1238111879.24.0.444942566073.issue4294@psf.upfronthosting.co.za>
2009-03-26 23:57:57vstinnerlinkissue4294 messages
2009-03-26 23:57:57vstinnercreate