Custom operator

Diez B. Roggisch deets_noospaam at web.de
Thu Feb 5 17:12:20 EST 2004


mathias wrote:

> I would like to define a custom operator in Python.
> (It is not about overloading an existing operator but about
> defining special new operators)
> 
> Is this possible without deeply manipulating the Python code?
> 
> Are side-effects to be expected?
> 
> What about operator precedence?
> 
> Can one define an operator to be right- or left -associative?

AFAIK thats part of the python grammar - so you can't do it. If your really
need such stuff, you might be able to create a custom language, or a
preprocessor.

What do you actually want to introduce?

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list