From a4ffd9468c4bf3bd9da9b40cb336eb91bfdbf987 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 31 Oct 2015 12:59:29 +0000 Subject: Move Python runtime into resources --- src/main/resources/python/runtime/_couscous.py | 5 +++++ src/main/resources/python/runtime/java/lang/Integer.py | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 src/main/resources/python/runtime/_couscous.py create mode 100644 src/main/resources/python/runtime/java/lang/Integer.py (limited to 'src/main/resources/python') diff --git a/src/main/resources/python/runtime/_couscous.py b/src/main/resources/python/runtime/_couscous.py new file mode 100644 index 0000000..0183f0b --- /dev/null +++ b/src/main/resources/python/runtime/_couscous.py @@ -0,0 +1,5 @@ +def _div_round_to_zero(a, b): + return -(-a // b) if (a < 0) ^ (b < 0) else a // b + +def _mod_round_to_zero(a, b): + return -(-a % b) if (a < 0) ^ (b < 0) else a % b \ 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 new file mode 100644 index 0000000..052f799 --- /dev/null +++ b/src/main/resources/python/runtime/java/lang/Integer.py @@ -0,0 +1,3 @@ +class Integer(object): + def parseInt(value): + return int(value) -- cgit v1.2.3