Subclassing builtins or another alternative
Courageous
jkraska at san.rr.com
Tue Dec 11 19:30:04 EST 2001
More information about the Python-list mailing list
Tue Dec 11 19:30:04 EST 2001
- Previous message (by thread): Subclassing builtins or another alternative
- Next message (by thread): Subclassing builtins or another alternative
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have an external C-extension type. Let's call it "Agent". I would like to allow coders using Agent to use it syntactically as a normal baseclass. For example, import agent class Pilot ( agent.Agent ): i=3 def f(self): pass Misfortunately, either one can't do this or I simply misunderstand what to hook up in the extension. Neither the setattr() or setattro() methods appear to get invoked by either the class-level data assignment of "i=3" or the definition of the f method on the class. What, by the way, are the difference between setattr() and setattro()? And can I do what I'm trying to do? If so, how? If read some of the xxsubclass code and the like, but I'm still not grokking. C//
- Previous message (by thread): Subclassing builtins or another alternative
- Next message (by thread): Subclassing builtins or another alternative
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list