MCPcopy Index your code
hub / github.com/RustPython/RustPython / complex1

Class complex1

Lib/test/test_complex.py:619–624  ·  view source on GitHub ↗

Test usage of __complex__() with a __new__() method

Source from the content-addressed store, hash-verified

617 return 42j
618
619 class complex1(complex):
620 """Test usage of __complex__() with a __new__() method"""
621 def __new__(self, value=0j):
622 return complex.__new__(self, 2*value)
623 def __complex__(self):
624 return self
625
626 class complex2(complex):
627 """Make sure that __complex__() calls fail if anything other than a

Callers 1

test_constructorMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_constructorMethod · 0.68