Skip to content

BUG: (Typing) binary_repr does not seem to accept unsignedinteger[_8Bit] although it does #24319

@bersbersbers

Description

@bersbersbers

Describe the issue:

np.binary_repr accepts a scalar integer array, but mypy does not like that.

Reproduce the code example:

import numpy as np

print(np.binary_repr(np.uint8(5)))

Error message:

(project_3.11) C:\Code\project>mypy bug.py
bug.py:3: error: Argument 1 to "binary_repr" has incompatible type "unsignedinteger[_8Bit]"; expected "int"  [arg-type]
Found 1 error in 1 file (checked 1 source file)

Runtime information:

1.25.1
3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
mypy 1.4.1 (compiled: yes)

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions