True
Mark Hammond
mhammond at skippinet.com.au
Tue Aug 5 19:18:13 EDT 2003
Daniel Klein wrote:
> Thanks François. I don't need to support multiple versions. I simply
> changed the code from:
>
> true = (1 == 1)
>
> to
>
> true = 1
>
> and presto, no more bug :-)
For the sake of being pedantic, I believe your code still does have a
bug. You bug is that you rely on the "str()" of a boolean value
returning a specific string. Your code should probably check the bool
and create your own string rather than relying on this behaviour
remaining unchanged forever.
In fact, in Python 2.4, I heard you will get this behaviour:
Python 2.4a0 (#46, Jul 31 2003, 10:15:54) [MSC v.1200 32 bit (Intel)] on
win32
>>> True
'Does a bear shit in the woods?'
<wink> ly,
Mark.
More information about the Python-list
mailing list