Checking whether bool is a type

Paul Rubin http
Mon Jul 28 04:04:30 EDT 2003


jan at jandecaluwe.com (Jan Decaluwe) writes:
> > 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. 

You could try "type(1==1) == type(1)"




More information about the Python-list mailing list