How to extend inner classes?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • harold fellermann

    #1

    How to extend inner classes?

    Thank you very much. Of course I know how to do it in python. The
    problem is that I want to reimplement these classes as a python
    extension in C. The question is: how can I add class members (like
    e.g. inner classes) to a PyTypeObject defined in a C extension?

    - harold -

    [color=blue]
    > You can define a class variable Pos with the class Pos as its value
    >
    > class PeriodicGrid :
    > class Pos:
    > pass
    > Pos = Pos
    >[color=green][color=darkred]
    > >>> grid = PeriodicGrid()
    > >>> grid.Pos()[/color][/color]
    > <__main__.Pos instance at 0x00EEFAD0>
    >
    > Ciao
    > Kay[/color]
Working...