[C++-sig] Enumerating items in pyste

Nicodemus nicodemus at esss.com.br
Fri Oct 24 02:01:22 CEST 2003


Niall Douglas wrote:

>When I go:
>
>cclass=Class('MyClassB', 'myinclude.h')
>
>... and myinclude.h contains two class definitions (MyClassB and 
>MyClassA), I notice that pyste sets the one you asked for as the 
>default so cclass refers to cclass.MyClassB. However, cclass.MyClassA 
>is still available.
>
>Pushing past this, does Class() merely extract classes from the 
>header file and nothing else? What about enums? And how can I 
>enumerate cclass eg;
>
>classes=Class('MyClassB', 'myinclude.h')
>for cclass in classes.contents():
>    execfile('Policies/'+cclass.name()+'.py')
>    eval(cclass.name()+'.apply()')
>  
>

Pyste doesn't support this yet. The actual parsing is done later, so at 
the point where the Pyste file is being executed, it doesn't know about 
the members of the class MyClassB. 8/
I intend to support what you want, but not in the near future.

Regards,
Nicodemus.





More information about the Cplusplus-sig mailing list