From 49c93e183b736973c664889d28c4f4b51eb0efe9 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Sat, 25 Feb 2023 19:11:43 +0900 Subject: [PATCH] Update __hello__ --- Lib/__hello__.py | 16 ++++++++++++++++ vm/Lib/python_builtins/__hello__.py | 1 + vm/src/frozen.rs | 11 ++++++----- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 Lib/__hello__.py create mode 120000 vm/Lib/python_builtins/__hello__.py diff --git a/Lib/__hello__.py b/Lib/__hello__.py new file mode 100644 index 0000000000..c09d6a4f52 --- /dev/null +++ b/Lib/__hello__.py @@ -0,0 +1,16 @@ +initialized = True + +class TestFrozenUtf8_1: + """\u00b6""" + +class TestFrozenUtf8_2: + """\u03c0""" + +class TestFrozenUtf8_4: + """\U0001f600""" + +def main(): + print("Hello world!") + +if __name__ == '__main__': + main() diff --git a/vm/Lib/python_builtins/__hello__.py b/vm/Lib/python_builtins/__hello__.py new file mode 120000 index 0000000000..f6cae8932f --- /dev/null +++ b/vm/Lib/python_builtins/__hello__.py @@ -0,0 +1 @@ +../../../Lib/__hello__.py \ No newline at end of file diff --git a/vm/src/frozen.rs b/vm/src/frozen.rs index 44bcf23c57..8c809aa372 100644 --- a/vm/src/frozen.rs +++ b/vm/src/frozen.rs @@ -11,11 +11,12 @@ pub fn core_frozen_inits() -> impl Iterator { }; } - ext_modules!( - iter, - source = "initialized = True; print(\"Hello world!\")\n", - module_name = "__hello__", - ); + // keep as example but use file one now + // ext_modules!( + // iter, + // source = "initialized = True; print(\"Hello world!\")\n", + // module_name = "__hello__", + // ); // Python modules that the vm calls into, but are not actually part of the stdlib. They could // in theory be implemented in Rust, but are easiest to do in Python for one reason or another.