← 输入框|github.com|刷新
Skip to content

Further tweaking whats_left: allow differing implementation - #2764

Merged
youknowone merged 1 commit into
RustPython:masterfrom
jamestwebber:further-tweak-whats-left
Jul 29, 2021
Merged

youknowone merged 1 commit into
RustPython:masterfrom
jamestwebber:further-tweak-whats-left

Conversation

@jamestwebber

Copy link
Copy Markdown
Contributor

In #2760 I introduced a regression. Sometimes RustPython will have an object defined in a different module from the one CPython defines it in. This is probably fine (implementations can be different) as long as the code is working (which this script doesn't test anyway).

For example, CPython's posix module defines its own chdir, cpu_count, etc. In RustPython the implementations are coming from os.py (maybe actually in os.rs?). Or for instance, CPython sys.stderr has no module defined (getmodule returns None) but RustPython will return _io. In these cases I think we'd want to count those as implemented, even though the code location is different.

So, this just adds an option keep_other to the scanning code. When in CPython, the script only keeps members from the module itself (as well as those that are undefined), to reduce redundancy in the output. But in the RustPython code it will consider anything, in case implementations are coming from other modules.

This takes another 177 lines off the output 😁

@youknowone
youknowone merged commit 29ee5ca into RustPython:master Jul 29, 2021
@jamestwebber
jamestwebber deleted the further-tweak-whats-left branch July 29, 2021 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants