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
I am using Grasshopper-stubs in VSCode and I am running into a problem with some overloaded classes? It appears that the fix is to include an explicit overload import in the stub .pyi file?
Argument of type "Literal[1]" cannot be assigned to parameter "Other" of type "GH_Path" in function "init"
"Literal[1]" is incompatible with "GH_Path"
It works fine at runtime of course, since an intis an acceptable argument type for GH_Path.
Proposed Fix
It appears that VSCode is not able to automatically resolve the @overload in the stub file for some reason, which is leading to this error?
However, if overload is imported from typing: from typing import Tuple, Set, Iterable, List, overload
Then in that case, the linting seems to resolve properly:
The text was updated successfully, but these errors were encountered:
Hi,
I am using Grasshopper-stubs in VSCode and I am running into a problem with some overloaded classes? It appears that the fix is to include an explicit
overload
import in the stub .pyi file?Scenario:
give me the linting error:
It works fine at runtime of course, since an
int
is an acceptable argument type forGH_Path
.Proposed Fix
It appears that VSCode is not able to automatically resolve the @overload in the stub file for some reason, which is leading to this error?
However, if
overload
is imported from typing:from typing import Tuple, Set, Iterable, List, overload
Then in that case, the linting seems to resolve properly:
The text was updated successfully, but these errors were encountered: