Author stefan.richthofer
Recipients onealj, stefan.richthofer
Date 2017-02-27.14:55:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Javen, thanks for looking into this!
I'd prefer to not change inspect, because long-term goal is to use an unmodified std-lib.
Also, it would be nice if the call inspect uses to detect a module (isinstance(object, types.ModuleType)) would be workable outside of inspect for Java-modules.

I see two places where this might be fixable inside of Jython:

1) Look at
It sets up baseClass and bases (List<PyObject> visibleBases).
Maybe adding ModuleType somehow to bases could fix according isinstance-calls. (Not sure if plainly adding that type goes well through isinstance; additional tweaks might be required.)

2) Look at
Thant method backs Python's isinstance on Java-side. You could add special treatment for PyJavaType to fix inspect's module-detection call.

I feel like 1) would be the most "down to the root"-fix possible. If 1) isn't workable, 2) would be a good still Jython-internal alternative.

Maybe a combination of 1) and 2) would also be an option. E.g. in 1) add ModuleType to bases and fix 2) if it doesn't properly take them into account.
Date User Action Args
2017-02-27 14:55:43stefan.richthofersetmessageid: <>
2017-02-27 14:55:43stefan.richthofersetrecipients: + stefan.richthofer, onealj
2017-02-27 14:55:43stefan.richthoferlinkissue2545 messages
2017-02-27 14:55:42stefan.richthofercreate