python 3.1 - DictType not part of types module? -
this found in install of python 3.1 on windows.
where can find other types, dicttype , stringtypes?
>>> print('\n'.join(dir(types))) builtinfunctiontype builtinmethodtype codetype frametype functiontype generatortype getsetdescriptortype lambdatype memberdescriptortype methodtype moduletype tracebacktype __builtins__ __doc__ __file__ __name__ __package__ >>>
according doc of types
module (http://docs.python.org/py3k/library/types.html),
this module defines names object types used standard python interpreter, not exposed builtins
int
orstr
are. ...typical use
isinstance()
orissubclass()
checks.
since dictionary type can used dict
, there no need introduce such type in module.
>>> isinstance({}, dict) true >>> isinstance('', str) true >>> isinstance({}, str) false >>> isinstance('', dict) false
(the examples on int
, str
outdated too.)
Comments
Post a Comment