One of the cool things about Python is the ability to "decorate" objects
with random extra members:
class C:
def __init__(self):
self.foo = 0
c = C()
c.bar = 1
I have a class implemented in C using tp_members to specify (read-only)
access to data members in the C struct. I'd like to be able to do the
decoration trick with objects of this class. Is this possible?
[The documentation for tp_dictoffset eseems to hint that this is
possible..... how do I use it?]
--
http://mail.python.org/mailman/listinfo/python-list
- Re: Can an object of a C type have random members added?... Gregory Bond
- Re: Can an object of a C type have random members a... Denis S. Otkidach