From: <bc...@wo...> - 2001-04-22 18:36:09
|
[Uncle Roastie] >I'm operating under the impression that JPython cannot use CPython code. That depends on the module. Most modules works with both Jython and CPython. >Brian Zimmer's additional comment suggests the same thing that >John Mudd says - just import glob from CPython. Correct. In fact the glob.py module distributed with Jython-2.0 is a binary copy taken from CPython-2.0 >There is something conceptually that I'm missing here. >Why isn't something like the CPython glob module a part of >the JPython distribution It is. It will be installed when the "Library modules" checkbox is selected during installation. >if they can interoperate? Are we expected to >have both distributions on our search paths - No. By default the installation will install a selfcontained jython environment. Some users with more advanced requirements can have both distributions on the search path. >but then, if that is >the case, why does JPython duplicate so much of CPython? ??? What are you saying here? A major part of the CPython standard library is distributed with Jython exactly because that part works with Jython. >There is some missing concept here that I haven't pick up on. >I don't think JPython and CPython are meant to interoperate. Yes they are. To the fullest extend possible. >Bruce Eckels says in his excellent "Thinking in Patterns" that >you can use things like the glob module, but where does it come from, >since it's not in JPython/Jython, It is in Jython-2.0. >and I'm still making the assumption >that CPython and JPython do not interoperate? Not all CPython modules can work in jython. Some modules depend on dll/.so extension, others depend on the CPython implementation such as the Python byte codes and yet other modules fails because of bugs in Jython. >I think the answer hasn't been made yet, which is why I'm still asking >questions. I hope the question have been answered now. regards, finn |