Update __hello__ and __phello__ from cpython

This commit is contained in:
Jeong YunWon
2023-02-24 14:48:34 +09:00
parent 496006d629
commit ad20a404a9
8 changed files with 38 additions and 5 deletions

16
Lib/__hello__.py vendored Normal file
View File

@@ -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()

7
Lib/__phello__/__init__.py vendored Normal file
View File

@@ -0,0 +1,7 @@
initialized = True
def main():
print("Hello world!")
if __name__ == '__main__':
main()

0
Lib/__phello__/ham/__init__.py vendored Normal file
View File

0
Lib/__phello__/ham/eggs.py vendored Normal file
View File

7
Lib/__phello__/spam.py vendored Normal file
View File

@@ -0,0 +1,7 @@
initialized = True
def main():
print("Hello world!")
if __name__ == '__main__':
main()

View File

@@ -0,0 +1 @@
../../../Lib/__hello__.py

View File

@@ -0,0 +1 @@
../../../Lib/__phello__

View File

@@ -11,11 +11,12 @@ pub fn core_frozen_inits() -> impl Iterator<Item = (String, FrozenModule)> {
};
}
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.