[Python-Dev] PY_SSIZE_T_MIN? (original) (raw)

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Wed Apr 5 19:54:13 CEST 2006


Congratulations to the Python 2.5a1 release! I started adjusting Boost.Python to work with this new release and it is going very well. I noticed this #define in pyport.h:

#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))

However, I couldn't find a corresponding PY_SSIZE_T_MIN which would come in handy to adjust old code using INT_MIN (from limits.h). Are there arguments against defining PY_SSIZE_T_MIN? Or is this just an oversight?

Objects/longobject.c uses:

return -PY_SSIZE_T_MAX-1;

To maximize consistency this would seem ideal to me:

pyport.h:

#define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)

longobject.c:

return PY_SSIZE_T_MIN;

Cheers, Ralf


Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com



More information about the Python-Dev mailing list