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 mark.dickinson
Recipients Aahz, aahz, amaury.forgeotdarc, mark.dickinson, pitrou, rhettinger, stutzbach
Date 2010-10-07.15:53:47
SpamBayes Score 6.611091e-05
Marked as misclassified No
Message-id <1286466829.35.0.619674254513.issue10044@psf.upfronthosting.co.za>
In-reply-to
Content
+#define _PyLong_IS_SMALL_INT(v) \
+    (((PyLongObject *)(v)) >= _PyLong_small_ints && \
+     ((PyLongObject *)(v)) < _PyLong_SMALL_INTS_END)
+/* These macros purposedly avoid a cast to int, since it is most of time
+   useless, and sometimes detrimental (because of truncation).
+   XXX _PyLong_AS_SMALL_INT might be slower if sizeof(PyLongObject) is not
+   a power of two.
+   */

Urk!  This is nasty.  :(

I don't think arbitrary comparisons of pointers give well-defined results, unless those pointers both happen to point into the same array.  (Might be wrong;  I don't have a copy of the C standard to hand.)
History
Date User Action Args
2010-10-07 15:53:49mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, aahz, amaury.forgeotdarc, pitrou, stutzbach, Aahz
2010-10-07 15:53:49mark.dickinsonsetmessageid: <1286466829.35.0.619674254513.issue10044@psf.upfronthosting.co.za>
2010-10-07 15:53:47mark.dickinsonlinkissue10044 messages
2010-10-07 15:53:47mark.dickinsoncreate