function operators

Jonathan Gardner jgardn at alumni.washington.edu
Tue Nov 27 02:55:16 CET 2001


James A. H. Skillen wrote:
> Has anyone ever wished that Python had operators defined on functions?
> For example, suppose you want the function f(x) = cos(x) + sin(x).
> You could do:
>
<snip>
> Does this make sense, or have I been doing too much mathematics? ;-)
>

Great idea.

But

Too complicated. It's pretty easy to make them the traditional way. The new 
syntax would only make python that much harder to read.

I think this goes along the lines of why there is no ? : construct. You can 
just use an if/else, and it reads much easier besides.

Jonathan




More information about the Python-list mailing list