[Tutor] funny true or false

Michael Janssen Janssen@rz.uni-frankfurt.de
Fri May 9 12:47:28 2003


On Fri, 9 May 2003, Magnus Lyck=E5 wrote:

> At 16:29 2003-05-09 +0800, ali wrote:
> >isn't this weird and may lead to confusion (of course, is your using Tru=
e or
> >False as variables and not as constants)...
>
> A name is just a name is just a name in Python.
> You can use it for whatever you like if want
> to make life miserable. But usually, we don't,
> since we prefer a calm and happy life. :)

Fair point but you can also do reasonable things this way: defining your
own True and False doing the right thing in any context you need.

Just think of the python cookbook mentions a None-Type that do in any
context nothing (instead of throwing TypeErrors).


Michael