I'm running into a confusing error when using mypy to check a project using PyYAML. Relevant code: ```python raw = yaml.load(some_str, Loader=yaml.FullLoader) ``` Error message (from `mypy --strict`): ``` error: Call to untyped function "load" in typed context ``` Yet the [typeshed](https://github.com/python/typeshed/blob/master/third_party/2and3/yaml/__init__.pyi#L18) has: ```python def load(stream: Union[str, IO[str]], Loader=...) -> Any: ... ``` Versions: • OS: macOS 10.14.3 • Python: 3.7.2 (installed via Homebrew) • Pipenv: 2018.11.26 • mypy: 0.670 • PyYAML: 5.1 (If this belongs in the [mypy repo](https://github.com/python/mypy), I'm happy to move it.)
Activity
JelleZijlstra commentedon Mar 26, 2019
This might be because
Loaderis untyped in typeshed.adamtheturtle commentedon Jul 1, 2019
This was fixed in #3035.
AMWJ commentedon Sep 30, 2022
This doesn't appear resolved? #3035 adds no types to the
load()method'sLoaderargument, soLoader's type remains Unknown.It appears #1657 attempted to resolve this incorrectly, and #1695 reverted. I think this should be re-opened until
load()andload_all()are typed.Akuli commentedon Oct 2, 2022
Feel free to submit a PR :)
adamtheturtle commentedon Oct 2, 2022
Apologies for my mistake.
Avasam commentedon Feb 20, 2023
Is this fixed by #9752 ?
AlexWaygood commentedon Feb 21, 2023
Looks like it!