Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TYP: false positive when using __ge__ between NDArray[np.str_] #28708

Copy link
Copy link
Closed
@MarcoGorelli

Description

@MarcoGorelli
Issue body actions

Describe the issue:

Spotted here: #28689 (comment)

Comparing NPArray[np.str_] using __ge__ erroneously raises when type checking

Reproduce the code example:

import numpy as np
import numpy.typing as npt

def foo(a: npt.NDArray[np.str_]) -> None:
    a > a

Error message:

Operator ">" not supported for types "NDArray[str_]" and "NDArray[str_]" (reportOperatorIssue)

Python and NumPy Versions:

import sys, numpy; print(numpy.version); print(sys.version)

Type-checker version and settings:

$ pyright --version
WARNING: there is a new pyright version available (v1.1.398 -> v1.1.399).
Please install the new version or set PYRIGHT_PYTHON_FORCE_VERSION to latest

pyright 1.1.398

Additional typing packages.

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.