Ulrich Eckhardt wrote:
[how to handle bitfields and enumerations in Python]
Thanks to all that answered. The important lessons I learned:
* You can modify classes, other than in C++ where they are statically
defined. This allows e.g. adding constants.
* __repr__ should provide output suitable as
John Machin wrote:
On Apr 16, 10:13 am, Dave Angel wrote:
For the Color example, how's this for a starting place:
class Color(object):
def __init__(self, name, enum):
self.enum =num
self.name =ame
setattr(Color, name, self)
@staticmethod
def seal():
On Apr 16, 10:13 am, Dave Angel wrote:
>
> For the Color example, how's this for a starting place:
>
> class Color(object):
> def __init__(self, name, enum):
> self.enum = enum
> self.name = name
> setattr(Color, name, self)
>
> @staticmethod
> def seal():
>
Ulrich Eckhardt wrote:
Greetings!
I'm currently using Python to implement a set of tests for code that is
otherwise written in C. This code was wrapped using Boost.Python and is
then loaded into Python as module.
What I often have in C is this:
// bitfield (several flags combined)
#define
On Wed, 15 Apr 2009 12:51:31 +0200, Ulrich Eckhardt wrote:
Hi,
> I'm currently using Python to implement a set of tests for code that is
> otherwise written in C. This code was wrapped using Boost.Python and is
> then loaded into Python as module.
...
> What I'm looking for is a suggestion how to
Ulrich Eckhardt wrote:
Greetings!
I'm currently using Python to implement a set of tests for code that is
otherwise written in C. This code was wrapped using Boost.Python and is
then loaded into Python as module.
What I often have in C is this:
// bitfield (several flags combined)
#define
Greetings!
I'm currently using Python to implement a set of tests for code that is
otherwise written in C. This code was wrapped using Boost.Python and is
then loaded into Python as module.
What I often have in C is this:
// bitfield (several flags combined)
#define STATUS_OVERTEMP 1u
#def