February 2006
Intermediate to advanced
648 pages
14h 53m
English
The types module defines names for all the built-in object types. The contents of this module are often used in conjunction with the built-in isinstance() function and other type-related operations.
Many of the objects in the types module are available as built-ins. For example, the built-in functions int(), long(), complex(), bool(), list(), dict(), tuple(), slice(), str(), unicode(), xrange(), and file() are actually type objects (in fact, they are exactly the same objects as referenced in the types module). Therefore, it is never necessary to use the longer name. For instance, writing isinstance(x,int) is the same as isinstance(x,types.IntType).
The module defines the following types:
| Variable | Description |
|---|---|
| BooleanType | Type of Boolean integers ... |
Read now
Unlock full access