<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 9, 2014 at 9:03 PM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">...</div>There's nothing stopping alternative implementations having their own<br>
implementation-specific standard library modules.<br>
<br>
steve@orac:/home/s$ jython<br>
Jython 2.5.1+ (Release_2_5_1, Aug 4 2010, 07:18:19)<br>
[OpenJDK Server VM (Sun Microsystems Inc.)] on java1.6.0_27<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> import java<br>
>>><br>
<br></blockquote><div><br></div><div>Small nit: Jython does implement a number of implementation-specific modules in its version of the standard library; jarray comes to mind, which is mostly but not completely superseded by the standard array module.</div>
<div>However, the java package namespace is not part of the standard library, it's part of the standard Java ecosystem and it's due to a builtin import hook:<br></div><div><br></div><div><div>Jython 2.7b3+ (default:6cee6fef06f0, Jun 9 2014, 22:29:14)</div>
<div>[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_60</div><div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> import sys</div>
<div>>>> sys.path</div><div>['', '/home/jbaker/jythondev/jython27/dist/Lib', '__classpath__', '__pyclasspath__/', '/home/jbaker/.local/lib/jython2.7/site-packages', '/home/jbaker/jythondev/jython27/dist/Lib/site-packages']</div>
</div><div><br></div><div>The entry __classpath__ means search CLASSPATH for Java packages; this includes the Java runtime, rt.jar, from which you get package namespaces as java.*, javax.*, sun.*, etc.</div><div><br></div>
<div>Another behavior that you get for free in Jython is being able to also import the org.python.* namespace, which is Jython's own runtime. Some of the implementations of standard library modules, such as threading, take advantage of this support.</div>
<div><br></div><div>- Jim</div><div><br></div></div></div></div>