Skip to content

Conversation

@FFY00
Copy link
Member

@FFY00 FFY00 commented Mar 10, 2023

Fixes #434

@FFY00 FFY00 force-pushed the fix-mypy branch 4 times, most recently from 6321180 to 3f1c9bc Compare March 10, 2023 03:10
Signed-off-by: Filipe Laíns <lains@riseup.net>
@jaraco
Copy link
Member

jaraco commented Mar 18, 2023

This code makes me sad. It looks like the typing system requires overloads anywhere where a None is the default fallback object? It took me many minutes just to try to comprehend what's going on here and it's degrading the readability of the get_all method. The reader now has to incorporate additional concepts (Optional, overload) and reconcile the two interfaces just to reason about what, without typing checks, is a simple concept (failobj=None).

Moreover, this test fails the diffcov because it fails to cover the new line 23 (an ellipsis).

What ever happened to "elegance begets simplicity"?

Is there any expectation that this behavior will ever be simplified? I guess I can link to the PRs for those who need to track down the origin.

@jaraco
Copy link
Member

jaraco commented Mar 18, 2023

For reference - upstream change at python/typeshed#9620 and possible long-term simplification at python/typing#307.

@jaraco
Copy link
Member

jaraco commented Mar 18, 2023

This change also introduces errors in the docs build:

/home/runner/work/importlib_metadata/importlib_metadata/importlib_metadata/_meta.py:docstring of typing._overload_dummy:1: WARNING: py:class reference target not found: _T

@jaraco jaraco merged commit b944c37 into python:main Mar 18, 2023
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.

mypy failing

2 participants