![Previous Page](../icons/previous.gif) |
![Up One Level](../icons/up.gif) |
![Next Page](../icons/next.gif) |
Extending and Embedding the Python Interpreter |
![Contents](../icons/contents.gif) |
![](../icons/blank.gif) |
2. Defining New Types
As mentioned in the last chapter, Python allows the writer of an
extension module to define new types that can be manipulated from
Python code, much like strings and lists in core Python.
This is not hard; the code for all extension types follows a pattern,
but there are some details that you need to understand before you can
get started.
Note:
The way new types are defined changed dramatically (and for the
better) in Python 2.2. This document documents how to define new
types for Python 2.2 and later. If you need to support older
versions of Python, you will need to refer to older versions of this
documentation.
![Previous Page](../icons/previous.gif) |
![Up One Level](../icons/up.gif) |
![Next Page](../icons/next.gif) |
Extending and Embedding the Python Interpreter |
![Contents](../icons/contents.gif) |
![](../icons/blank.gif) |
Release 2.3.3, documentation updated on December 19, 2003.
See About this document... for information on suggesting changes.