-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
runtime:
akuli@akuli-desktop:/tmp$ cat asd.py
class Foo:
def __index__(self):
return 1
akuli@akuli-desktop:/tmp$ python3.7 -c 'import cmath, asd; cmath.sin(asd.Foo())'
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: must be real number, not Foo
akuli@akuli-desktop:/tmp$ python3.8 -c 'import cmath, asd; cmath.sin(asd.Foo())'
akuli@akuli-desktop:/tmp$
(The error message is wrong, the functions also accept complex numbers)
Stub:
Line 11 in 05cc30b
| _C = Union[SupportsFloat, SupportsComplex, complex] |
Line 30 in 05cc30b
| def sin(__z: _C) -> complex: ... |
Metadata
Metadata
Assignees
Labels
No labels