can I overload operators like "=>", "->" or something like that?

Kiuhnm kiuhnm03.4t.yahoo.it
Fri Apr 20 12:45:00 EDT 2012


On 4/20/2012 17:50, Nobody wrote:
> On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote:
>
>> can I somehow overload operators like "=>", "->" or something like that?
>> (I'm searching for appropriate overload for logical implication "if a then
>> b")
>
> You cannot create new operators, but you can control how existing
> operators work on types which you define.
>
> IOW, you can't define "->" or "=>", but you could define">=" or ">>".

You can also "overload" '<-' ;)

Kiuhnm



More information about the Python-list mailing list