customizing and/or/not

Aahz aahz at
Wed Aug 13 04:59:03 CEST 2003

In article <pan.2003. at>,
Simon Burton  <simonb at> wrote:
>Just reading about the new Sets... and this came up.
>Why can't we customize the and/or/not operators?
>I see this as making one's own boolean type.
>Is it possible?

Not directly, but you can use the arithmetic bit operators, just like
sets do: __and__(), __or__(), and __invert__()
Aahz (aahz at           <*>

This is Python.  We don't care much about theory, except where it intersects 
with useful practice.  --Aahz

More information about the Python-list mailing list