Checking whether bool is a type

Jan Decaluwe jan at jandecaluwe.com
Mon Jul 28 02:16:26 EDT 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.

Regards, Jan

--
Jan Decaluwe - Resources bvba
Losbergenlaan 16, B-3010 Leuven, Belgium
mailto:jan at jandecaluwe.com
http://jandecaluwe.com




More information about the Python-list mailing list