logo       

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

programming.swig

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

Thanks for your reply.

From: mmatus@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Swig] Preventing a user to refer to non-existent struct members
Date: September 15, 2004 4:28:39 pm GMT-04:00
To: rhl@xxxxxxxxxxxxxxxxxxx
Cc: swig@xxxxxxxxxxxxxxx

If you send a small example of what is needed, we can try to add it to
the system as a feature (or global option) to force the C-structure
to be a "closed one",

So, please send what is needed to "close" the following structure

struct Foo {
int bar;
};
and also, a good name for the feature, "close structure" is not good.

extensible?

You mean in python, I imagine. I don't know how to do this generically,
and in fact my solution is currently crashing python (as in, dumping
me into gdb). I'll get back to you.

The problem with using %pythoncode is that the __slots__ variable has
to be set within the class definition. It's possible that there's
some other simple solution, messing with __setattr --- but my simple
solution there also crashed python. Swig must be being "Clever".

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