mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
properly lookup the __round__ special method (closes #17722)
This commit is contained in:
parent
c1ab0bd788
commit
214a7d2674
3 changed files with 15 additions and 15 deletions
|
@ -1743,7 +1743,7 @@ order (MRO) for bases """
|
|||
return b"hello"
|
||||
def empty_seq(self):
|
||||
return []
|
||||
def zero(self):
|
||||
def zero(self, other=None):
|
||||
return 0
|
||||
def complex_num(self):
|
||||
return 1j
|
||||
|
@ -1789,6 +1789,7 @@ order (MRO) for bases """
|
|||
("__trunc__", int, zero, set(), {}),
|
||||
("__ceil__", math.ceil, zero, set(), {}),
|
||||
("__dir__", dir, empty_seq, set(), {}),
|
||||
("__round__", round, zero, set(), {}),
|
||||
]
|
||||
|
||||
class Checker(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue