STINNER Victor <[email protected]> added the comment:
> 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.
----------
Added file: http://bugs.python.org/file13427/pylong_macros-3.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue4294>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com