From: Chris K. <cla...@ca...> - 2000-11-28 02:07:52
|
All, I would like to use PyLists and PyDictionaries interchangably between Java and Jython. I thought of subclassing PyDictionary and implementing the Map interface, but there's a name collision with the "values()" method (as PyDictionary returns a PyList. Friggin' Java and it's lack of return type overloading.) Needless to say, I thought of one other way, modify the PyList and PyDictionary classes so that they implement the above-mentioned interfaces. Given that they use Java classes under the hood that do support these interfaces, these methods would simply be a pass-through to the protected object's methods by the same name. Additionally, given that PyLists would (indirectly) implement the Collection interface, the values() method would make both Jython and Java happy. I can probably perform these changes and send a patch set out via e-mail...Interested? Also, one other thing of note: I've been trying to execute CGI scripts under the Servlet architecture without having to make code mods to the Python script (or at least making minimal changes.) As such, I've implemented a cgi.FieldStorage class in Java that acts like the CPython equivalent, as well as a Java class equivalent for Cookie.SimpleCookie. They're surely not fully-fleshed out and may have bugs but I would be quite happy to send the source out via e-mail or post them to an appropriate site. It might be worthwhile to include them as standard libraries once the bugs are all worked out and they're fully compatable with the CPython equivalents. |