# Original Python 3.9.6 complex construction and numeric-member scenario.
z = complex(real=-0.0, imag=-0.0)
print(z, z.real, z.imag, z.conjugate())
for text in ("j", "-j", "1+2j", "( 1_0-2.5e-1J )", "\u2003\u0661\u0662+\u0969j\u00a0", "-0-0j", "nan-infj"):
    value = complex(text)
    print(repr(text), value, value.real, value.imag)
class Base:
    def __complex__(self):
        print("complex method")
        return 4j
class Child(Base):
    pass
item = Child()
item.__complex__ = None
print(complex(item, 2j))
print((3).real, (3).imag, True.real, True.imag, (-0.0).conjugate())
try:
    complex("1 +2j")
except ValueError as error:
    print(str(error))
