From: Kevin D. <kda...@we...> - 2001-07-12 15:12:08
|
Jython does a great job emulating Python objects in Java. It also, through reflection, does a great job of letting you use Java methods, etc. in Jython. It seems like it would be useful to have a base class that gives you both sets of behavior out of the box: - it would have a __dict__ to store things in - it would use reflection to find out about Java methods - it would look like a python class and allow you to use Jython's multiple inheritance mechanism This type of thing would allow you to easily build all sorts of extensions to Jython. In situations where someone is more comfortable or it is more convenient to do something in Java, you can still make objects that look like python objects to Jython programs. I'm just coming back to this after a couple of weeks away, but if memory serves subclassing PyObject doesn't give __dict__ or reflection. Subclassing PyInstance does give you a functional __dict__, but doesn't do reflection. Subclassing PyClass actually can give both but PyClasses are not quite the same. And there are a lot of private and protected members in there which prevent easy subclassing. Has anyone else been interested in such a thing? Any suggestions on an approach to take? Thanks, Kevin |