8000 stubtest: error if a dunder method is missing from a stub by AlexWaygood · Pull Request #12203 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

stubtest: error if a dunder method is missing from a stub #12203

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 13 commits into from
Feb 19, 2022
Merged
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
flake8
  • Loading branch information
AlexWaygood authored Feb 17, 2022
commit 8324e2fd2d16e1b5e8eaa49227ce3467d62c301d
5 changes: 3 additions & 2 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,11 @@ def _belongs_to_runtime(r: types.ModuleType, attr: str) -> bool:
# These two are basically useless for type checkers
"__hash__",
"__getattr__",
"__abstractmethods__", # For some reason, mypy doesn't infer that classes with ABCMeta as the metaclass have this inherited
# For some reason, mypy doesn't infer classes with metaclass=ABCMeta inherit this attribute
"__abstractmethods__",
"__doc__", # Can only ever be str | None, who cares?
"__del__", # Only ever called when an object is being deleted, who cares?
"__new_member__", # If an enum class defines `__new__`, the method is renamed to be `__new_member__`
"__new_member__", # If an enum defines __new__, the method is renamed as __new_member__
})


Expand Down
0