MCPcopy Index your code
hub / github.com/python/cpython / complex1

Class complex1

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

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

Source from the content-addressed store, hash-verified

612 return 42j
613
614 class complex1(complex):
615 """Test usage of __complex__() with a __new__() method"""
616 def __new__(self, value=0j):
617 return complex.__new__(self, 2*value)
618 def __complex__(self):
619 return self
620
621 class complex2(complex):
622 """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

Used in the wild real call sites across dependent graphs

searching dependent graphs…