logo       

Preventing a user to refer to non-existent struct members: msg#00106

programming.swig

Subject: Preventing a user to refer to non-existent struct members

I've found that a fruitful source of bugs is setting (at the python level)
non-existent elements in C-level structs.

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?

R

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise