[Python-Dev] return type of complex (original) (raw)
Maciej Fijalkowski fijall at gmail.com
Fri Oct 19 16:21:06 CEST 2012
- Previous message: [Python-Dev] return type of __complex__
- Next message: [Python-Dev] return type of __complex__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Oct 19, 2012 at 4:13 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
On Fri, Oct 19, 2012 at 11:08 PM, Antonio Cuni <anto.cuni at gmail.com> wrote:
Is that the real intended behavior? Given the way complex numbers interact with floats generally, returning a complex number with no imaginary component as a floating point value seems legitimate and the checks in cmath overly strict. Otherwise you would get redundancy like: def complex(self): return complex(value) or def complex(self): return value + 0j More importantly, relaxing the checks in cmath is backwards compatible. while tightening up the checks in complexnew is not. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/fijall%40gmail.com
Cool, can we get it for 2.7?
- Previous message: [Python-Dev] return type of __complex__
- Next message: [Python-Dev] return type of __complex__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]