|
Re: Preventing a user to refer to non-existent struct members: msg#00108programming.swig
On Wed, 15 Sep 2004, Robert Lupton wrote: > I can avoid this (in python 2.3 at least) by setting __slots__ in the > class definition to the C-level members (i.e. > .__swig_getmethods__.keys()). > > Unfortunately, I don't see how I can do this without post-processing the > swig-generated interface.py file. Is there a trick known to the > cognoscenti? Or is there a better way of doing this? I know nothing about __slots__ or __swig_getmethods__, but I think you can use %pythoncode to insert code that will accomplish the modifications that you describe. Something along these lines might do the trick: %pythoncode %{ for foo in globals().values(): if type(foo) == type and not foo == object: foo.__slots__ = foo.__swig_getmethods__.keys() %} Josh -- Joshua L. Cherry, Ph.D. NCBI/NLM/NIH (Contractor) jcherry@xxxxxxxxxxxxxxxx _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Preventing a user to refer to non-existent struct members: 00108, Marcelo Matus |
|---|---|
| Next by Date: | Re: Minor Bug in Java directors, and a patch: 00108, Scott Michel |
| Previous by Thread: | Re: Preventing a user to refer to non-existent struct membersi: 00108, Robert Lupton |
| Next by Thread: | Re: Preventing a user to refer to non-existent struct members: 00108, Marcelo Matus |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |