[Python-Dev] return type of __complex__
Greg Ewing
greg.ewing at canterbury.ac.nz
Sat Oct 20 01:35:13 CEST 2012
More information about the Python-Dev mailing list
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 "<stdin>", line 1, in <module> > 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 ]
More information about the Python-Dev mailing list