| |
comp.lang.python |
>>>>0 == False > True > But, I know I can use [] to represent False as in >>>>if not []: print 'empty' > ... > But then doing the following gives a surprising (to me!) result >>>>[] == False > False > Could anybody point out why this is the case? > Thanks, py> isinstance(False, int) James
> This is a slightly naive question, but I know that 0 can be used to
> represent False. So
> empty
> Rajarshi
True
py> isinstance([], int)
False
py> bool([])
False