[Python-Dev] return type of complex (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Sat Oct 20 01:35:13 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 ]
Antonio Cuni wrote:
Traceback (most recent call last): File "", line 1, in TypeError: complex should return a complex object
i.e., the complex constructor does not check that complex returns an actual complex, while the cmath functions do.
Looks to me like cmath is being excessively finicky here. Why shouldn't a float be usable in any context expecting a complex?
-- Greg
- Previous message: [Python-Dev] return type of __complex__
- Next message: [Python-Dev] return type of __complex__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]