Hi, while fixing pypy to pass CPython 3.2 tests, I found what I think it's a inconsistency in how CPython (both 2.7 and 3.2) handles __complex__: >>> class Obj: ... def __complex__(self): ... return 2.0 ... >>> obj = Obj() >>> complex(obj) (2+0j) >>> >>> import cmath >>> cmath.acos(obj) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: __complex__ should return a complex object i.e., the complex constructor does not check that __complex__ returns an actual complex, while the cmath functions do. To me it looks like a bug in complex_new which should do the check as well; however, there is a test in test_complex.test_constructor which checks that returning a float actually works. Is that the real intended behavior? ciao, Anto
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4