Skip to content

Commit c6aa379

Browse files
committed
Merge commit '870e9e7331c3b525e59f3139c8ec755e510f92e6' into release/graal-vm/1.0
2 parents b1cb6d3 + 870e9e7 commit c6aa379

File tree

399 files changed

+14284
-11869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

399 files changed

+14284
-11869
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
This changelog summarizes major changes between GraalVM versions of the Python
44
language runtime. The main focus is on user-observable behavior of the engine.
55

6+
## Version 1.0.0 RC7
7+
8+
* Enhance the `java` interop builtin module with introspection utility methods
9+
10+
## Version 1.0.0 RC6
11+
12+
* Support regular expression patterns built from bytes by using CPython's sre module as a fallback engine to our own
13+
* Support LLVM 5+ for C extension modules
14+
* Introduce native sequence storage so that e.g. Python bytes exposed to C can be mutated
15+
* Introduce lazy string concatenation to significantly speed up benchmarks where strings are concatenated repeatedly
16+
* C-API improvements to support more scikit-learn code
17+
* Fix our distinction between builtin functions, functions, and methods to make the classes for builtin functions equivalent to CPython
18+
* Improve set, frozenset, and dict support
19+
* Attach Python exceptions as cause to ImportErrors raised for C extension modules
20+
* Update standard library to CPython 3.6.5
21+
* Support more code object attributes
22+
* Support constant type ids for objects that are interned on CPython
23+
* Add collections.deque
24+
* Document how to contribute
25+
* Improve efficiency of generators
26+
* Enable re-use of ASTs in multiple Contexts in the same Engine
27+
628
## Version 1.0.0 RC5
729

830
* Generator expressions now properly evaluate their first iterator in the definition scope at definition time

ci.jsonnet

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
overlay: "2562524065c42e18d4a5ea57e8cbf6cac6b9bdda",
2+
overlay: "934f7a99e60cbc8d0affd873805c057b576f3709",
33

44
// ======================================================================================================
55
//
@@ -45,8 +45,8 @@
4545
//
4646
// ------------------------------------------------------------------------------------------------------
4747
local utils = {
48-
download: function(name, version, platformspecific = true)
49-
{name: name, version: version, platformspecific: platformspecific},
48+
download: function(name, version, platformSpecific = true)
49+
{name: name, version: version, platformspecific: platformSpecific},
5050

5151
getValue: function(object, field)
5252
if (!std.objectHas(object, field)) then
@@ -127,7 +127,7 @@
127127

128128
local labsjdk8Mixin = {
129129
downloads +: {
130-
JAVA_HOME: utils.download("labsjdk", "8u172-jvmci-0.46"),
130+
JAVA_HOME: utils.download("labsjdk", "8u172-jvmci-0.48"),
131131
EXTRA_JAVA_HOMES : { pathlist: [utils.download("oraclejdk", "11+20")] },
132132
},
133133
environment +: {

doc/INTEROP.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,41 @@ def python_method():
4949
return "Hello from Python!"
5050
```
5151

52+
Finally, to interoperate with Java (only when running on the JVM), you can use
53+
the `java` module:
54+
```python
55+
import java
56+
BigInteger = java.type("java.math.BigInteger")
57+
myBigInt = BigInteger(42)
58+
myBigInt.shiftLeft(128) # public Java methods can just be called
59+
myBigInt["not"]() # Java method names that are keywords in
60+
# Python can be accessed using "[]"
61+
byteArray = myBigInt.toByteArray()
62+
print(list(byteArray)) # Java arrays can act like Python lists
63+
```
64+
65+
In addition to the `type` builtin method, the `java` module, exposes the following
66+
methods as well:
67+
68+
Builtin | Specification
69+
--- | ---
70+
`instanceof(obj, class)` | returns `True` if `obj` is an instance of `class` (`class` must be a foreign object class)
71+
`is_function(obj)` | returns `True` if `obj` is a Java host language function wrapped using Truffle interop
72+
`is_object(obj)` | returns `True` if `obj` if the argument is Java host language object wrapped using Truffle interop
73+
`is_symbol(obj)` | returns `True` if `obj` if the argument is a Java host symbol, representing the constructor and static members of a Java class, as obtained by `java.type`
74+
75+
```python
76+
import java
77+
ArrayList = java.type('java.util.ArrayList')
78+
my_list = ArrayList()
79+
print(java.is_symbol(ArrayList)) # prints True
80+
print(java.is_symbol(my_list)) # prints False, my_list is not a Java host symbol
81+
print(java.is_object(ArrayList)) # prints True, symbols are also host objects
82+
print(java.is_function(my_list.add))# prints True, the add method of ArrayList
83+
print(java.instanceof(my_list, ArrayList)) # prints True
84+
```
85+
86+
5287
#### Python responses to Truffle interop messages
5388

5489
###### READ

graalpython/benchmarks/src/benchmarks/binarytrees.py

Lines changed: 0 additions & 76 deletions
This file was deleted.

graalpython/benchmarks/src/benchmarks/binarytrees3t.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

graalpython/benchmarks/src/benchmarks/bm-ai.py

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)