diff options
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/java/org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java | 8 | ||||
| -rw-r--r-- | src/main/resources/python/runtime/java/lang/Integer.py | 4 |
2 files changed, 8 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 6d6db82..87fc0ac 100644 --- a/src/main/java/org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java +++ b/src/main/java/org/zwobble/couscous/backends/python/PythonPrimitiveMethods.java @@ -124,10 +124,18 @@ public class PythonPrimitiveMethods { .put("same", arguments -> pythonIs(arguments.get(0), arguments.get(1))) .build(); + + private static final Map<String, PrimitiveStaticMethodGenerator> BOXED_INT_STATIC_METHODS = + ImmutableMap.<String, PrimitiveStaticMethodGenerator>builder() + + .put("parseInt", arguments -> pythonCall(pythonVariableReference("int"), arguments)) + + .build(); private static final Map<TypeName, Map<String, PrimitiveStaticMethodGenerator>> STATIC_METHODS = ImmutableMap.<TypeName, Map<String, PrimitiveStaticMethodGenerator>>builder() .put(InternalCouscousValue.REF, INTERNAL_METHODS) + .put(ObjectValues.BOXED_INT, BOXED_INT_STATIC_METHODS) .build(); public static Optional<PrimitiveMethodGenerator> getPrimitiveMethod(TypeName type, String methodName) { diff --git a/src/main/resources/python/runtime/java/lang/Integer.py b/src/main/resources/python/runtime/java/lang/Integer.py index fcd85a9..8a55b33 100644 --- a/src/main/resources/python/runtime/java/lang/Integer.py +++ b/src/main/resources/python/runtime/java/lang/Integer.py @@ -1,9 +1,5 @@ class Integer(object): @staticmethod - def parseInt__java_lang_String__int(value): - return int(value) - - @staticmethod def valueOf__int__java_lang_Integer(value): return value |
