By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,574 Members | 1,535 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,574 IT Pros & Developers. It's quick & easy.

How to extend inner classes?

P: n/a
Hi all,

I try to implement a C extension module that uses inner classes. The
structure of the corresponding python code is the following:

class PeriodicGrid :
class Pos :
# [...]

class NofluxGrid :
class Pos :
# [...]

I wrote the PyTypeObjects for PeriodicGrid, NofluxGrid, PeriodicPos, and
NofluxPos. Now I want to add each PosType to the appropriate Grid's
dictionary, so that I can write something like
from cGrid import *
grid = PeriodicGrid(10,10)
pos = grid.Pos(1,2)


in my python program. What is the general way to add class members
(instead of instance members which is done by a PyMemberDef array) to the
PyTypeObject?

Any help appreciated,

- harold -

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.