Skip to content

Typing: Unexpected keyword argument kind for isin #24491

Closed

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

Activity

  1. added 2 commits that reference this issue on Aug 24, 2023
    050382b
    d75fcfe
  2. added a commit that references this issue on Aug 25, 2023
    c790693
  3. added a commit that references this issue on Aug 25, 2023
    603311d
  4. added a commit that references this issue on Nov 11, 2023
    a2725d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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