4.4. Internal Types

  • Code

  • Frame

  • Traceback

  • Slice

  • Ellipsis

  • Xrange

We will briefly introduce these internal types here. The general application programmer would typically not interact with these objects directly, but we include them here for completeness. Please refer to the source code or Python internal and online documentation for more information.

In case you were wondering about exceptions, they are now implemented as classes not types. In older versions of Python, exceptions were implemented as strings.

4.4.1. Code Objects

Code objects are executable pieces of Python source that are byte-compiled, usually as return values from calling the compile() built-in function. Such objects are appropriate for execution by either exec or by the eval() built-in ...

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.