ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
ActivePython 2.4
Python Documentation
Extending and Embedding
Front Matter
Contents
1. Extending Python with C or C++
2. Defining New Types
2.1 The Basics
2.2 Type Methods
3. Building C and C++ Extensions with distutils
4. Building C and C++ Extensions on Windows
5. Embedding Python in Another Application
A. Reporting Bugs
B. History and License
About this document ...

MyASPN >> Reference >> ActivePython 2.4 >> Python Documentation >> Extending and Embedding
ActivePython 2.4 documentation


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.



See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved