[Types-sig] Re: Type equivalence
Fri, 16 Mar 2001 07:08:10 -0800
It would not be inconsistent for Python's boolean-style operators to
work on multiple types and yet for Python to have a first-class boolean
type. C++ is one example of a language with this behavior. Nobody is
particularly confused by it.
One way to make it all feel object-oriented and orthogonal is to say
that __nonzero__ is a cast-to-boolean operator.
Take a recipe. Leave a recipe.
Python Cookbook! http://www.activestate.com/pythoncookbook