Kent Johnson wrote:
> [EMAIL PROTECTED] wrote:
> > Aren't there boolean literals for "True" and "False" in Python
> > (jython)? I can't get "true", "True", "false", or "False" to work. I
> > ended up having to use "(1==1)" and "(1==0)".
>
> No, there are not. Jython implements Python 2.1 which did not have boolean
> literals. You
> can just use 1 and 0.
>
The latest jython is 2.2a1 (which does have True and False as ints)
You could declare your own True and False like this:
class Boolean:
__init__(self, value):
self.__value = value
__repr__(self):
return self.__value != 0
__int__(self):
return int(self.__value)
and so on.
then, True = Boolean(1)
and False = Boolean(0)
Cheers,
Keir
--
http://mail.python.org/mailman/listinfo/python-list