[Python-Dev] [Python-checkins] cpython: Enhance Py_ARRAY_LENGTH(): fail at build time if the argument is not an array
Victor Stinner
victor.stinner at haypocalc.com
Thu Sep 29 03:45:59 CEST 2011
Le jeudi 29 septembre 2011 02:07:02, Benjamin Peterson a écrit :
> 2011/9/28 victor.stinner <python-checkins at python.org>:
> > http://hg.python.org/cpython/rev/36fc514de7f0
> > changeset: 72512:36fc514de7f0
> > user: Victor Stinner <victor.stinner at haypocalc.com>
> > date: Thu Sep 29 01:12:24 2011 +0200
> > summary:
> > Enhance Py_ARRAY_LENGTH(): fail at build time if the argument is not an
> > array
> >
> > Move other various macros to pymcacro.h
> >
> > Thanks Rusty Russell for having written these amazing C macros!
> >
> > files:
> > Include/Python.h | 19 +--------
> > Include/pymacro.h | 57 +++++++++++++++++++++++++++
>
> Do we really need a new file? Why not pyport.h where other compiler stuff
> goes?
I'm not sure that pyport.h is the right place to add Py_MIN, Py_MAX,
Py_ARRAY_LENGTH. pyport.h looks to be related to all things specific to the
platform like INT_MAX, Py_VA_COPY, ... pymacro.h contains platform independant
macros.
I would like to suggest the opposite: move platform independdant macros from
pyport.h to pymacro.h :-) Suggestions:
- Py_ARITHMETIC_RIGHT_SHIFT
- Py_FORCE_EXPANSION
- Py_SAFE_DOWNCAST
Victor
More information about the Python-Dev
mailing list