Skip to content

The any key/whats left fix #1888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ To test RustPython, do the following:

$ git clone https://github.com/RustPython/RustPython
$ cd RustPython
$ export RUSTPYTHONPATH=Lib
$ cargo run demo.py
Hello, RustPython!

Expand Down
19 changes: 16 additions & 3 deletions tests/generator/not_impl_modules_footer.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@


def dir_of_mod_or_default(module, default=None):
try:
mod=set(dir(__import__(module)))
return mod
except:
return default

rustpymods = list(
map(
lambda mod: mod[0],
Expand All @@ -11,22 +18,28 @@ rustpymods = list(
)
rustpymods += list(sys.builtin_module_names)


not_imported=set('not imported')
rustpymods = dict(map(
lambda mod: (
mod,
set(dir(__import__(mod)))
if mod not in ("this", "antigravity")
else None,
dir_of_mod_or_default(mod, not_imported)
if mod not in ("this", "antigravity") else None
),
rustpymods
))


for modname, cpymod in cpymods.items():
if modname in rustpymods:
rustpymod = rustpymods[modname]
if rustpymod:
if rustpymod==not_imported:
print(f"{modname} (existing but not importable)")
continue
for item in cpymod - rustpymod:
print(f"{modname}.{item}")
else:
print(f"{modname} (entire module)")