Booleans (was Re: My .02 on PEP308 + an extra question)

Magnus Lie Hetland mlh at furu.idi.ntnu.no
Sun Mar 2 10:03:42 EST 2003


In article <yu99isv1vo0n.fsf at europa.research.att.com>, Andrew Koenig wrote:
[snip]
>In particular, despite the disadvantages of allowing implicit
>conversions to and from bool, the type has two substantial advantages:
>
>        1) You don't have to worry about combining libraries that
>           use different conventions for representing boolean types.
>        2) You can overload based on it.
>
>These two advantages -- particularly the first -- were deemed to be
>sufficient by themselves to justify introducing a new type.

How are these advantages related to Python, if at all? Certainly the
second is not, unless you are using type checking (which you rarely
should). Maybe the first is relevant -- I can't see exactly how...

I realize that you were talking about C++ -- I'm just curious :)

-- 
Magnus Lie Hetland               "Nothing shocks me. I'm a scientist." 
http://hetland.org                                   -- Indiana Jones




More information about the Python-list mailing list