Issue 17722: 'round' function doesn't honour a descriptor round (original) (raw)

Created on 2013-04-13 20:02 by mark.dickinson, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
round_descriptor.patch mark.dickinson,2013-04-13 20:02 review
round_descriptor2.patch mark.dickinson,2013-04-13 20:08 review
Messages (8)
msg186813 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2013-04-13 20:02
Benjamin pointed out on #python-dev that the builtin round function should be using _PyObject_LookupSpecial to look up the __round__ method. Here's a fix.
msg186815 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2013-04-13 20:05
Whoops. That patch introduces a new refleak; will fix shortly.
msg186817 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2013-04-13 20:08
Non-leaky patch.
msg186848 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-04-13 21:09
Perhaps it will be good to add a new test when X doesn't not have a special method. I don't see this case is covered.
msg186854 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-13 21:19
New changeset cc59c215f19e by Benjamin Peterson in branch 'default': properly lookup the __round__ special method (closes #17722) http://hg.python.org/cpython/rev/cc59c215f19e
msg186855 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-04-13 21:19
Sorry for trampling on you; I had a patch already in my wc.
msg186860 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2013-04-13 21:54
No problem. Do you usually keep patches in your WC?
msg186861 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-04-13 21:56
In this case, I had almost finished a patch as I was talking with you on IRC, but I had to go play in a show for 3 hours.
History
Date User Action Args
2022-04-11 14:57:44 admin set github: 61922
2013-04-13 21:56:03 benjamin.peterson set messages: +
2013-04-13 21:54:44 mark.dickinson set messages: +
2013-04-13 21:19:55 benjamin.peterson set nosy: + benjamin.petersonmessages: +
2013-04-13 21:19:09 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: patch review -> resolved
2013-04-13 21:09:14 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2013-04-13 20:08:55 mark.dickinson set files: + round_descriptor2.patchmessages: +
2013-04-13 20:05:20 mark.dickinson set messages: +
2013-04-13 20:02:20 mark.dickinson create