See All Titles |
![]() ![]() typesThe 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."
|
Index terms contained in this sectionmodulestypes types module |
© 2002, O'Reilly & Associates, Inc. |