Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update __hello__ and __phello__ from cpython
  • Loading branch information
youknowone committed Feb 25, 2023
commit ad20a404a91d425eadd9831ffe0ee3d3d2342771
16 changes: 16 additions & 0 deletions Lib/__hello__.py
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions Lib/__phello__/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialized = True

def main():
print("Hello world!")

if __name__ == '__main__':
main()
Empty file added Lib/__phello__/ham/__init__.py
Empty file.
Empty file added Lib/__phello__/ham/eggs.py
Empty file.
7 changes: 7 additions & 0 deletions Lib/__phello__/spam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialized = True

def main():
print("Hello world!")

if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions vm/Lib/python_builtins/__hello__.py
1 change: 1 addition & 0 deletions vm/Lib/python_builtins/__phello__
11 changes: 6 additions & 5 deletions vm/src/frozen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down