Skip to content

Typing: Unexpected keyword argument kind for isin #24491

@bersbersbers

Description

@bersbersbers

Describe the issue:

The implementation of isin has a kind argument

def isin(element, test_elements, assume_unique=False, invert=False, *,
kind=None):

that is missing in the type hints:

def isin(
element: ArrayLike,
test_elements: ArrayLike,
assume_unique: bool = ...,
invert: bool = ...,
) -> NDArray[bool_]: ...

Reproduce the code example:

import numpy as np

np.isin([1, 2, 3], [1], kind="table")

Error message:

# mypy bug.py
bug.py:3: error: Unexpected keyword argument "kind" for "isin"  [call-arg]
bug.py:3: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-call-arg for more info
Found 1 error in 1 file (checked 1 source file)

Runtime information:

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

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions