numpy / numpy/numtype

Reflected arithmetic binary ops don't accept `list` array-likes

Open
#589 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

numpy.generic stubs: Incomplete
Dominant language
Python
Stars
79
Forks
8
PR merge metrics
No merged PRs in 30d

Description

e.g. [2] / np.float64(1) is rejected by type-checkers, but accepted at runtime.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the reflected arithmetic operator annotations for NumPy scalar types and the type-checker tests covering array-like operands. Reproduce the [2] / np.float64(1) example, then update the relevant typing behavior so the accepted runtime case is accepted by type-checkers and add or adjust a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.