Checking whether bool is a type
jan at jandecaluwe.com
Mon Jul 28 08:16:26 CEST 2003
"Terry Reedy" <tjreedy at udel.edu> wrote in message
> If all you care about is differentiating between 2.2 and 2.3, yes.
> But this raises NameError, I believe, on earlier verisons without
> 'bool' builtin. What is wrong with using sys.version[:3] >= '2.3'?
> (Anyone - has sys.version always been around?)
Nothing - I do a general version check like that on 2.2
because I need generators.
I was writing unit tests that specifically tests features that
I can only support when bool is a type. I found it clearer
to directly test for that.
Jan Decaluwe - Resources bvba
Losbergenlaan 16, B-3010 Leuven, Belgium
mailto:jan at jandecaluwe.com
More information about the Python-list