How to extend inner classes?

Discussion in 'Python' started by harold fellermann, Dec 21, 2004.

  1. 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 -


    > You can define a class variable Pos with the class Pos as its value
    >
    > class PeriodicGrid :
    > class Pos:
    > pass
    > Pos = Pos
    >
    > >>> grid = PeriodicGrid()
    > >>> grid.Pos()

    > <__main__.Pos instance at 0x00EEFAD0>
    >
    > Ciao
    > Kay
     
    harold fellermann, Dec 21, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carlo v. Dango
    Replies:
    14
    Views:
    1,065
    Alex Martelli
    Oct 19, 2003
  2. Replies:
    0
    Views:
    332
  3. Kay Schluehr

    How to extend inner classes?

    Kay Schluehr, Nov 27, 2004, in forum: Python
    Replies:
    1
    Views:
    344
    Alex Martelli
    Nov 28, 2004
  4. Kay Schluehr

    How to extend inner classes?

    Kay Schluehr, Nov 28, 2004, in forum: Python
    Replies:
    0
    Views:
    359
    Kay Schluehr
    Nov 28, 2004
  5. Juha Nieminen
    Replies:
    9
    Views:
    946
    Kai-Uwe Bux
    Jun 13, 2011
Loading...

Share This Page