Home

On Fri, 07 Sep 2007 17:40:44 +0200, Jorgen Bodde wrote:

> is the bool derived from 'int' in some way?

Yes.

>>> issubclass(bool, int)
True


> What is the best way to
> check if the config I want to write is an int or a bool ?

if isinstance(value, bool):
print "it's a bool, or a subclass of bool"
elif isinstance(value, int):
print "it's an int, or a subclass of int other than bool"



--
Steven.

previous
next

Re: C++ Primer ex 7.6
Re: MemoryError on reading mbox file
Re: Conversions from decimal to binary,hex
Re: Naming dictionaries recursively
Re: question about for cycle
Fundacja Sloneczko
Pajacyk
Niechciane i Zapomniane
Kidprotect
Fundacja Iskierka