Skip to content
Discussion options

You must be logged in to vote

You've enabled pyright's strict mode. In this mode, the reportUnknownMemberType check is enabled. This check reports the use of any member (attribute or method) whose type is Unknown or contains an Unknown somewhere within it.

In this case, the allclose method uses the type alias ArrayLike which is defined as follows:

ArrayLike = _DualArrayLike[
    dtype,
    Union[bool, int, float, complex, str, bytes],
]

The type dtype is a generic class that accepts a single type argument. Since none is provided, its type is dtype[Unknown]. That's the origin of the Unknown type that pyright is telling you about here. This isn't a bug in pyright. It's an omission in the numpy code, and it would need to…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by FrancescElies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants