From 549099039ef76a04ed524448c070a0c5328c52b2 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 15 Nov 2015 14:20:06 +0000 Subject: Handle boxing for return statements --- src/main/resources/python/runtime/java/lang/Boolean.py | 13 +++++++++++++ src/main/resources/python/runtime/java/lang/Integer.py | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 src/main/resources/python/runtime/java/lang/Boolean.py (limited to 'src/main/resources/python/runtime/java/lang') diff --git a/src/main/resources/python/runtime/java/lang/Boolean.py b/src/main/resources/python/runtime/java/lang/Boolean.py new file mode 100644 index 0000000..6e08f29 --- /dev/null +++ b/src/main/resources/python/runtime/java/lang/Boolean.py @@ -0,0 +1,13 @@ +class Boolean(object): + def __init__(self, value): + self._value = value + + def equals(self, other): + # TODO: test this properly + return isinstance(other, Boolean) and other._value == self._value + + def __str__(self): + return str(self._value) + + def __repr__(self): + return str(self) \ No newline at end of file diff --git a/src/main/resources/python/runtime/java/lang/Integer.py b/src/main/resources/python/runtime/java/lang/Integer.py index e16e7bb..8ea30a4 100644 --- a/src/main/resources/python/runtime/java/lang/Integer.py +++ b/src/main/resources/python/runtime/java/lang/Integer.py @@ -9,3 +9,9 @@ class Integer(object): def equals(self, other): # TODO: test this properly return isinstance(other, Integer) and other._value == self._value + + def __str__(self): + return str(self._value) + + def __repr__(self): + return str(self) \ No newline at end of file -- cgit v1.2.3