customizing and/or/not

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


In article <pan.2003.08.13.00.43.57.351955 at webone.com.au>,
Simon Burton  <simonb at webone.com.au> 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 pythoncraft.com)           <*>         http://www.pythoncraft.com/

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