8000 Possible issue with PyYAML's load() · Issue #2886 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content
Possible issue with PyYAML's load() #2886
Closed
@nkantar

Description

@nkantar

I'm running into a confusing error when using mypy to check a project using PyYAML.

Relevant code:

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 has:

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, I'm happy to move it.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: incompleteAnnotations or sub-modules missing from an existing package or module

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0