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
fromtypingimportTypeAlias, TypeVarIntOrStr: TypeAlias=int|strIntOrStrT=TypeVar("IntOrStrT", bound=IntOrStr)
deffunc(a: IntOrStrT) ->IntOrStrT:
ifisinstance(a, int):
...
a.as_integer_ratio# Cannot access member "as_integer_ratio" for type "str*"else:
...
returna
There is an error at line a.as_integer_ratio: Cannot access member "as_integer_ratio" for type "str*". Is this normal? There is no error in version 2023.11.10.
The text was updated successfully, but these errors were encountered:
This has been fixed in a newer version of pyright (the type checker upon which pylance is built). If you switch to the prerelease version of pylance, the error should go away.
pylance version:
2023.12.1
Look at the following code:
There is an error at line
a.as_integer_ratio
:Cannot access member "as_integer_ratio" for type "str*"
. Is this normal? There is no error in version2023.11.10
.The text was updated successfully, but these errors were encountered: