power TypeErrors

Fernando Pérez fperez528 at yahoo.com
Thu Nov 7 14:20:47 EST 2002


Erik Max Francis wrote:

> Note that in the interests of nitpickery, C99 does have a builtin
> complex type.

I know, and I'm happy to see it. Unfortunately, we all know how long it will 
be before C99 is fully supported by most compilers. I'll be glad when I can 
write C with complex numbers with no worries about portability or bizarre 
bugs.

[snip]

> That's probably the best rationalization I've seen for including complex
> number support in the language itself.  Implementing a complex number
> class oneself is pretty straightforward, and the vast majority of
> non-scientific users will never have a need for it, but when you want to
> do scientific work and the builtins don't play nice with complex
> numbers, it's a huge inconvenience.

Thanks. I actually am a bit irked that in python, things like the power 
operator and other math functions aren't 100% complex-safe. But I understand 
that is tricky to do right, and manpower is limited. Maybe as the language 
gains popularity in scientific circles, someone will come out with the time 
to go in and fix those ugly corners.

Cheers,

f



More information about the Python-list mailing list