KEMBAR78
stubtest: don't error for a missing submodule if the submodule name is private by AlexWaygood · Pull Request #13417 · python/mypy · GitHub
Skip to content

Conversation

AlexWaygood
Copy link
Member

If a module name is private, the contents of that module are likely considered implementation details by the package author. Sometimes we want to include these implementation details in a stub, and sometimes we don't, but in my opinion stubtest probably shouldn't error for these submodules being missing from the stub. This is in keeping with stubtest's approach for class and module attributes, where it generally doesn't emit an error if the attribute name is private.

…rivate

If a module name is private, the contents of that module are likely considered implementation details by the package author. Sometimes we want to include these implementation details in a stub, and sometimes we don't, but in my opinion stubtest probably shouldn't error for these submodules being missing from the stub. This is in keeping with stubtest's approach for class and module attributes, where it generally doesn't emit an error if the attribute name is private.
@AlexWaygood AlexWaygood changed the title stubtest: don't error for a missing submodule if the module name is private stubtest: don't error for a missing submodule if the submodule name is private Aug 15, 2022
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer doing this in test_module. Doing it here feels fragile; it feels like it would be easy to end up not checking private submodules even if the stub has them.

@AlexWaygood AlexWaygood marked this pull request as draft August 15, 2022 08:04
@AlexWaygood AlexWaygood marked this pull request as ready for review August 15, 2022 08:42
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants