aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-03-31 18:52:17 +0100
committerMichael Williamson <mike@zwobble.org>2016-03-31 18:52:17 +0100
commitd8ce86ca9dc976ad298613e2975d41817d662a59 (patch)
tree3c827f3dedc95ef7b022530a6db60afe63b2ca8c /src/main
parent3aa2448b1110c3c95ff64e4fd39ec82c79570b7c (diff)
Python backend: Implement Integer.valueOf as primitive method
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java1
-rw-r--r--src/main/resources/python/runtime/java/lang/Integer.py4
2 files changed, 1 insertions, 4 deletions
diff --git a/src/main/java/org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java b/src/main/java/org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java
index 40c794e..602fe2f 100644
--- a/src/main/java/org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java
+++ b/src/main/java/org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java
@@ -130,6 +130,7 @@ public class PythonPrimitiveMethods {
ImmutableMap.<String, PrimitiveStaticMethodGenerator>builder()
.put("parseInt", arguments -> pythonCall(pythonVariableReference("int"), arguments))
+ .put("valueOf", arguments -> arguments.get(0))
.build();
diff --git a/src/main/resources/python/runtime/java/lang/Integer.py b/src/main/resources/python/runtime/java/lang/Integer.py
index 4504cb1..48d6556 100644
--- a/src/main/resources/python/runtime/java/lang/Integer.py
+++ b/src/main/resources/python/runtime/java/lang/Integer.py
@@ -1,8 +1,4 @@
class Integer(object):
- @staticmethod
- def valueOf__int__Integer(value):
- return value
-
def __init__(self, value):
self._value = value