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 or str are. ...

typical use isinstance() or issubclass() 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

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -