You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pyright is doing the correct thing here. The typeshed stdlib "builtins.pyi" file specifies that the constructor for the str class must conform to one of the following overloads:
In your example above, the variable a is of type str at the time you call the str constructor the second time, and according to the builtins.pyi type information, this is not allowed.
If you believe this error is incorrect, you'll need to file a bug against (or submit a PR to) the typeshed repo. Pyright relies on the typeshed stubs for type information.
Describe the bug
No overloads for "str(str(a), "utf-8")" match parameters
Argument types: (str, Literal['utf-8']) Pyright (reportGeneralTypeIssues)
To Reproduce
Expected behavior
String encoding should be allowed
Screenshots or Code
If applicable, add screenshots or the text of the code (surrounded by triple back ticks) to help explain your problem.
VS Code extension or command-line
PyRight as VS Code extension (v1.1.43)
Additional context
Can be turned off by removing type hinting
The text was updated successfully, but these errors were encountered: