[New-bugs-announce] [issue32438] PyLong_ API cleanup

Erik Bray report at bugs.python.org
Thu Dec 28 05:19:25 EST 2017


New submission from Erik Bray <erik.m.bray at gmail.com>:

Per Serhiy's comment in this thread https://mail.python.org/pipermail/python-ideas/2017-December/048413.html (which I agree with), several of the PyLong_ functions have behavior carried over from Python 2 of calling __int__ on their arguments if the input is not a PyLongObject:

PyLong_AsLong
PyLong_AsLongAndOverflow
PyLong_AsLongLong
PyLong_AsLongLongAndOverflow
PyLong_AsUnsignedLongMask
PyLong_AsUnsignedLongLongMask

This behavior should probably be deprecated, and eventually removed.  Interfaces that should accept generic number-like objects should use the PyNumber API instead.

----------
components: Interpreter Core
messages: 309119
nosy: erik.bray
priority: normal
severity: normal
status: open
title: PyLong_ API cleanup
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32438>
_______________________________________


More information about the New-bugs-announce mailing list