Re: extension type attributes
Greg Ewing <[email protected]> Mon, 01 Jun 2009 13:40:26 +1200
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
Mark Ellis wrote: > Or you could implement __setattr__ and __getattr__ methods for your > class, in which case attributes can be whatever you want. These methods > could then default to accessing a dict object stored as part of the C > class struct, to act as 'normal' python object attributes. Possible, although a Python subclass of such a class would behave a little oddly, since its attributes wouldn't show up in the usual __dict__. -- Greg