Skip to content
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

Disable mypy error-code overload-overlap #12470

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Aug 1, 2024

Closes: #12178

@srittau
Copy link
Collaborator Author

srittau commented Aug 1, 2024

So ... is there a way to make stubtest ignore this error? (And why does stubtest even care about it?)

Copy link
Contributor

github-actions bot commented Aug 1, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

mypy (https://github.com/python/mypy)
- mypy/types.py:3126: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-overload-overlap for more info

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/exception.py:51: note: In module imported here:

streamlit (https://github.com/streamlit/streamlit)
+ scripts/get_min_versions.py:20: note: In module imported here:

@Daverball
Copy link
Contributor

Daverball commented Aug 2, 2024

So ... is there a way to make stubtest ignore this error? (And why does stubtest even care about it?)

It looks like you will need to use a custom mypy.ini or add a [tool.mypy] section to the pyproject.toml with the relevant disable_error_code setting. It might be a bit cleaner to use a common configuration file anyways, rather than manually keep the arguments in sync.

(Also I think it cares in so far, that any error code may indicate that some type information has been erased, so the stubtest output would not be testing the correct thing, it could try to be more clever and keep a list of error codes that don't ever affect the type information, but it seems like a lot of work for relatively little gain, it makes sense to me for it to expect clean mypy output with the expectation that mypy and stubtest have the same set of errors enabled through a common configuration file, so all the type information is accurate to the degree we care about)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable mypy overload-overlap warnings?
3 participants