< BACKMake Note | BookmarkCONTINUE >
152015024128143245168232148039199167010047123209178152124239215162146123188005206244093015

types

The types module stores the constant names of the built-in object types.

FunctionType, DictType, ListType, and StringType are examples of the built-in type names.

You can use these constants to find out the type of an object.

					
>>> import types
>>> if type("Parrot") == types.StringType:
…     	 Print "This is a string!"
…
This is a string

				

The complete list of built-in object types, that are stored at the types module, can be found in Chapter 5, "Object-Oriented Programming."


Last updated on 1/30/2002
Python Developer's Handbook, © 2002 Sams Publishing

< BACKMake Note | BookmarkCONTINUE >

Index terms contained in this section

modules
      types
types module

© 2002, O'Reilly & Associates, Inc.