SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 292 Python

Fix from Greg Chapman from SF bug #695651: a complex subclass

constructor, when passed a single complex argument, returns the
argument unchanged.  This should be done only for the complex base
class; a complex subclass should of course cast the value to the
subclass in this case.

The fix also revealed a segfault in complex_getnewargs(): the argument
for the Py_BuildValue() format code "D" is the *address* of a
Py_complex struct, not the value.  (This corroborated by the API
documentation.)

I expect this needs to be backported to 2.2.3.
G
Guido van Rossum committed
4eadfa2b2eeca190546261149cbf1607488dea0a
Parent: 41bcbe3