2007年08月21日

Python | BooleanはIntTypeでもある

どうも動作がおかしいと思ったら。知らなかったよ。

>>>from types import *
>>> isinstance(True, IntType)
True
>>> isinstance(False, IntType)
True
>>> isinstance(1, BooleanType)
False
>>> isinstance(0, BooleanType)
False
Posted by otsuka : 18:42 | Comment (0) | Trackback (0)
Comment









名前、アドレスを登録しますか?