[issue16290] PyComplex_AsCComplex should allow __complex__ to return float.

Mark Dickinson report at bugs.python.org
Sun Oct 28 12:46:51 CET 2012


Mark Dickinson added the comment:

I've been convinced by the python-dev discussion that Antonio was right: it's complex_new that's in error rather than the cmath functions.  Even so, it would be unsafe to change the behaviour in the maintenance releases.

Attaching a new patch that disallows 'float'-type returns from the __complex__ method.

----------
Added file: http://bugs.python.org/file27764/issue16290v2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16290>
_______________________________________


More information about the Python-bugs-list mailing list