where are isinstance types documented?
fredrik at pythonware.com
Tue Sep 26 12:19:21 CEST 2006
> I'm using the isinstance built-in function. I've found the docs for it,
> but there are no docs on the supported types.
*all* types and classes can be used.
> For example isinstance(a, int) works fine but isinstance(s, string)
> doesn't - because 'string is not known'.
> I do know how to import the types module and then use defined types
> such as 'types.StringType' - but the documentation says that from 2.2
> this is not the preferred way.
> So, where's the documentation for types I can use with isinstance, such
> as 'int'?
based on http://docs.python.org/ref/types.html, here's a list of the
most commonly used core types:
(singleton; use "is None" to test for this)
(any class defined using "class")
hope this helps!
More information about the Python-list