Skip to content

Commit 091afa6

Browse files
committed
Some wording udpates
1 parent 062bcd0 commit 091afa6

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

docs/user/Jython.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33
Most Jython code that uses Java integration will be based on a
44
stable Jython release, and these only come in Python 2.x versions.
55
GraalVM's Python runtime, in contrast, is only targeting Python 3.x.
6-
Thus, GraalVM does not provide full compatibility with these earlier 2.x versions of Jython.
6+
GraalVM does not provide a full compatibility with these earlier 2.x versions of Jython.
7+
Thus, a significant migration step will have to be taken to migrate all your code to Python 3.
78

8-
Thus, a significant migration step will have to be to migrate all your code to
9-
Python 3. For Jython specific features, follow this document to learn about
10-
migration to GraalVM's Python runtime.
9+
For Jython specific features, follow this document to learn about migration to GraalVM's Python runtime.
1110

12-
Be adviced: some features of Jython have a negative impact on runtime
13-
performance, and thus are disabled by default. To make migration easier, we
14-
enable some features with a command line flag on GraalVM:
15-
`--python.EmulateJython`.
11+
Note that some features of Jython have a negative impact on runtime performance, and are disabled by default.
12+
To make migration easier, you can enable some features with a command line flag on GraalVM: `--python.EmulateJython`.
1613

17-
### Importing
18-
There are certain features of Jython's Java integration that we also offer. Here
19-
is an example:
14+
## Importing Java Packages
15+
16+
There are certain features of Jython's Java integration that are enabled by default on GraalVM's Python runtime.
17+
Here is an example:
2018

2119
>>> import java.awt as awt
2220
>>> win = awt.Frame()
@@ -26,14 +24,13 @@ is an example:
2624
'java.awt.Dimension[width=200,height=200]'
2725
>>> win.show()
2826

29-
This example works exactly the same on both Jython and Python on
30-
GraalVM. However, on GraalVM only packages in the `java` namespace can be
31-
directly imported. Importing classes from packages outside `java` namespace also
32-
requires the `--python.EmulateJython` option to be active.
27+
This example works exactly the same on both Jython and Python on GraalVM.
28+
However, on GraalVM only packages in the `java` namespace can be directly imported.
29+
Importing classes from packages outside the `java` namespace also requires the `--python.EmulateJython` option to be active.
3330

34-
Additionally, importing Java packages as Python modules is only supported under
35-
very specific circumstances. This will work:
36-
```
31+
Additionally, importing Java packages as Python modules is only supported under very specific circumstances.
32+
For example, this will work:
33+
```python
3734
import java.lang as lang
3835
```
3936

0 commit comments

Comments
 (0)