[issue19617] Fix usage of Py_ssize_t type in Python/compile.c

Benjamin Peterson report at bugs.python.org
Mon Nov 18 14:18:31 CET 2013


Benjamin Peterson added the comment:

I meant where you added casts, you could use it.

2013/11/18 STINNER Victor <report at bugs.python.org>:
>
> STINNER Victor added the comment:
>
>> You could use the Py_SAFE_DOWNCAST macro everywhere.
>
> I prefer to store sizes in a size type (Py_ssize_t), and only downcast where it is really needed, in compiler_addop_i(). So in the future, if someone wants to support values larger than INT_MAX, only one function need to be changed.
>
> ----------
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue19617>
> _______________________________________

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19617>
_______________________________________


More information about the Python-bugs-list mailing list