Issue 32438: PyLong_ API cleanup (original) (raw)

Issue32438

Created on 2017-12-28 10:19 by erik.bray, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg309119 - (view) Author: Erik Bray (erik.bray) * (Python triager) Date: 2017-12-28 10:19
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.
msg309136 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-28 17:59
See also . And there may be other related issues.
msg358934 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2019-12-28 08:43
Is this related/resolved with issue 36048?
msg358942 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2019-12-28 12:38
@Batuhan: I think so, yes; at least, the "deprecated" part is done. The "eventually removed" is not, and I don't know whether we have a target version for that removal.
msg358944 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2019-12-28 12:44
Closing as a duplicate of #36048 (which isn't quite right, since this issue came first, but it's probably close enough).
History
Date User Action Args
2022-04-11 14:58:56 admin set github: 76619
2019-12-28 12:44:53 mark.dickinson set status: open -> closedsuperseder: Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__messages: + resolution: duplicatestage: resolved
2019-12-28 12:38:16 mark.dickinson set messages: +
2019-12-28 08:43:06 BTaskaya set nosy: + BTaskayamessages: +
2017-12-28 17:59:44 serhiy.storchaka set nosy: + mark.dickinson, stutzbach, serhiy.storchaka, lemburgmessages: + versions: + Python 3.7
2017-12-28 10:19:25 erik.bray create