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

Pylance GeneralTypeIssue #61

Closed
MadameMinty opened this issue Jun 23, 2023 · 1 comment · Fixed by #62
Closed

Pylance GeneralTypeIssue #61

MadameMinty opened this issue Jun 23, 2023 · 1 comment · Fixed by #62

Comments

@MadameMinty
Copy link

MadameMinty commented Jun 23, 2023

Very minor issue. The below code runs, but Pyright is upset about pyjson5.dump(). It doesn't react to regular json.

    import pyjson5
    file = 'path'
    cache = dict()
    with open(file, 'w') as f:
        pyjson5.dump(cache, f)
                            ^
Argument of type "TextIOWrapper" cannot be assigned to parameter "fp" of type "_SupportsWrite[str]" in function "dump"
  "TextIOWrapper" is incompatible with "_SupportsWrite[str]"

Pylance(reportGeneralTypeIssues)

(variable) f: TextIOWrapper
@Kijewski
Copy link
Owner

Thank you for your report! I fixed it in v1.6.3.

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 a pull request may close this issue.

2 participants