Override 'and' and 'or'

Andrew Durdin adurdin at gmail.com
Mon Oct 8 10:55:01 EDT 2007


On 10/7/07, Dekker <m.aschwanden at gmail.com> wrote:
>
> Well I think it is not possible what I wanted to achieve. By
> overriding the "and" and "or" keyword I wanted to return a new object:
>
> SqlValueInt(4) and SqlValueInt(5) --> SqlOpAnd(SqlValueInt(4),
> SqlValueInt(5))

PEP 335 is a proposal to allow overriding of the logical 'and', 'or' operators:

See <http://www.python.org/dev/peps/pep-0335/> and the discussion of
it at <http://mail.python.org/pipermail/python-dev/2004-September/048791.html>

A.



More information about the Python-list mailing list