-
Notifications
You must be signed in to change notification settings - Fork 765
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
Code is unexpectedly marked as unreachable #3195
Comments
The numpy library includes a type stub file called @overload
def cross(
a: _ArrayLikeBool_co,
b: _ArrayLikeBool_co,
axisa: int = ...,
axisb: int = ...,
axisc: int = ...,
axis: None | int = ...,
) -> NoReturn: ... The The the two arguments you are passing to Given the type information provided to pylance, it appears to be correctly analyzing the code and concluding that the call to |
Thanks for your clarification Eric! I just found this link which also illustrates why code is marked as unreachable in this case. |
Environment data
Code Snippet
Repro Steps
numpy
dependencies and run the above code.Expected behavior
Code should not be marked as unreachable
Actual behavior
The last line of code
print(z)
is marked as unreachable.It is also observed in other Python scripts where sections of code followed by
np.cross()
are marked as unreachable.The text was updated successfully, but these errors were encountered: