This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: No longer use implicit convertion to int with loss
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hpj, mark.dickinson, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2019-09-01 11:24 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15636 merged serhiy.storchaka, 2019-09-01 11:29
PR 20437 merged serhiy.storchaka, 2020-05-26 19:51
PR 20449 merged mark.dickinson, 2020-05-27 11:32
PR 17536 hpj, 2020-07-01 19:01
Messages (6)
msg350947 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-09-01 11:24
Use only the __index__() method for implicit conversion to iteger, and not __int__().

This converts deprecation warnings added in issue36048 into TypeError.
msg370004 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-05-26 15:43
New changeset 578c3955e0222ec7b3146197467fbb0fcfae12fe by Serhiy Storchaka in branch 'master':
bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)
https://github.com/python/cpython/commit/578c3955e0222ec7b3146197467fbb0fcfae12fe
msg370063 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2020-05-27 10:47
There are some comments in the Objects/longobject.c code that still refer to __int__, and could use an update.

For example: https://github.com/python/cpython/blob/7da46b676aed7111de34b57c8b942a7f3bb80327/Objects/longobject.c#L366
msg370072 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2020-05-27 12:43
New changeset 20941de0ddc39ce9f07e29b4cc770e8a9ef14d41 by Mark Dickinson in branch 'master':
bpo-37999: Fix outdated __int__ and nb_int references in comments (GH-20449)
https://github.com/python/cpython/commit/20941de0ddc39ce9f07e29b4cc770e8a9ef14d41
msg370173 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-05-28 08:12
I think it is all here. Thank you Mark for your review and for fixing outdated docs and comments.
msg372622 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-06-29 19:36
New changeset e67f7db3c34f70536f36c56bb82e33c3512a53a3 by Serhiy Storchaka in branch 'master':
bpo-37999: Simplify the conversion code for %c, %d, %x, etc. (GH-20437)
https://github.com/python/cpython/commit/e67f7db3c34f70536f36c56bb82e33c3512a53a3
History
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82180
2020-07-01 19:01:56hpjsetnosy: + hpj

pull_requests: + pull_request20417
2020-06-29 19:36:48serhiy.storchakasetmessages: + msg372622
2020-05-28 08:12:43serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.10
2020-05-28 08:12:29serhiy.storchakasetmessages: + msg370173
2020-05-27 12:43:20mark.dickinsonsetmessages: + msg370072
2020-05-27 11:32:31mark.dickinsonsetpull_requests: + pull_request19703
2020-05-27 10:47:00mark.dickinsonsetnosy: + mark.dickinson
messages: + msg370063
2020-05-26 19:51:33serhiy.storchakasetpull_requests: + pull_request19693
2020-05-26 15:43:49serhiy.storchakasetmessages: + msg370004
2019-09-01 11:29:07serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request15304
2019-09-01 11:24:04serhiy.storchakacreate