Roundup Robot added the comment:
New changeset 399e59ad0a70 by Mark Dickinson in branch 'default':
Issue #16290: __complex__ must now always return an instance of complex.
http://hg.python.org/cpython/rev/399e59ad0a70
--
nosy: +python-dev
___
Python
Changes by Mark Dickinson dicki...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16290
___
Mark Dickinson added the comment:
Jesús: see the first message.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16290
___
___
Python-bugs-list
Changes by Mark Dickinson dicki...@gmail.com:
--
nosy: +antocuni
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16290
___
___
Python-bugs-list
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
Jesús Cea Avión added the comment:
Mark, for the sake of keeping a reference in this bug entry, could you possibly
post the URL of the archived python-dev thread?
Thanks.
--
___
Python tracker rep...@bugs.python.org
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16290
___
___
Python-bugs-list mailing list
New submission from Mark Dickinson:
See thread starting at
http://mail.python.org/pipermail/python-dev/2012-October/122241.html
The cmath module functions don't accept custom types that define __complex__,
but whose __complex__ method returns a float rather than a complex number:
Python
Mark Dickinson added the comment:
Here's a patch
--
keywords: +patch
Added file: http://bugs.python.org/file27631/issue16290.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16290
___
Serhiy Storchaka added the comment:
Patch LGTM.
Is there a new feature, not a bugfix? If yes, then I expect some documentation
changes.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16290
Mark Dickinson added the comment:
Is there a new feature, not a bugfix?
There's an ongoing argument about that on the python-dev thread. :-) But yes,
I think this needs a doc update---even if it's considered a bugfix, the current
docs could be clarified.
Serhiy Storchaka added the comment:
My interpretation of that is that __int__ should return an int, __float__ a
float, __complex__ a complex number;
It's a reasonable interpretation. Changing it can be confusing.
On the other hand, int and float look like specialized subclasses of complex
Mark Dickinson added the comment:
This means that you should add a branch for integers too.
I'd rather not go that far, at least in this issue: we'd also end up changing
__float__ to allow it to return an int, in that case. If we're considering
that, the discussion should go back to
13 matches
Mail list logo