search for: swigtest

Displaying 1 result from an estimated 1 matches for "swigtest".

Did you mean: stigtest
2006 Sep 13
1
[Fwd: Re: [Swig-user] wrapping enums for python]
...ieb K M <intra611@gmail.com>: > Hi, > > When printing enum wrapped to python I would like to get symbol instead > of > number. For example > > in C++: > > enum min_max > { > SS_MIN = 0, > SS_MAX = 100 > }; > > > I get: > > print swigtest.SS_MAX > 100 > > and I would like to get: > > print swigtest.SS_MAX > SS_MAX > > So the idea was to use something like: > > %pythoncode %{ > > class Enum(int): > def __new__(cls, arg, desc ): > self = int.__new__(cls, arg) > self.desc...