From d8ce86ca9dc976ad298613e2975d41817d662a59 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 31 Mar 2016 18:52:17 +0100 Subject: Python backend: Implement Integer.valueOf as primitive method --- .../org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java | 1 + src/main/resources/python/runtime/java/lang/Integer.py | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'src') 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.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 -- cgit v1.2.3