Subclassing types in C

William Studenmund wrstuden at wasabisystems.com
Tue May 16 20:17:39 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I used the embedding python guide to embed python in an application  
to let me easily script the app. It's all working rather well, and  
I've added a number of types which expose the internals to python.

However I've gotten to the point where I want to add classes for part  
of the interface, and these class really should be subclasses of  
another one of my types. Well, subtypes. The Embedding guide doesn't  
cover this.

I found PEP 253, which partially covers this. It indicates that I  
should be able to do this. However: 1) the "Creating a subtype of a  
built-in type in C" section has an "XXX there should be a paragraph  
or two about argument passing here" comment, and 2) the PEP's  
abstract has an editor's note indicating that the PEP no longer  
describes the implementation.

So what do I need to do? Are the instructions in the PEP still correct?

Take care,

Bill
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEahdIDJT2Egh26K0RAuJIAJ406DDdXTu6VEfcW1yWa2Hg4wIIQACfVuCH
SBrwJOCqHIHZdFndfzJBMbo=
=aPMN
-----END PGP SIGNATURE-----



More information about the Python-list mailing list