Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`numpy.__array_namespace_info__().dtypes()["float64"] == None` is `True` but `numpy.float64 == None` is `False`

Open
#359 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reproducing the discrepancy with array_api_compat.numpy.array_namespace_info().dtypes()["float64"] and np.float64, then compare the behavior with the Array API specification linked in the issue. Done means resolving the inconsistent comparison behavior for the NumPy backend and covering the reported case with an appropriate test.

Written by the indexing model from the issue text.

Description

In my understanding, dtype can be any Python object in array API specification, and therefore may be None depending on the library. If the device is somewhat set to None while using numpy backend in array API compatible code, the above specification (https://github.com/numpy/numpy/issues/18434) causes various problems when working with dtypes.

> from array_api_compat import numpy as np
> np.__array_namespace_info__().dtypes()["float64"]
dtype('float64')
> np.float64
<class 'numpy.float64'>
> np.__array_namespace_info__().dtypes()["float64"] == np.float64
True
> np.__array_namespace_info__().dtypes()["float64"] == None
True
> np.float64 == None
False
Dominant language
Python
Stars
131
Forks
49
Avg merge
2d 8h
Merged PRs (30d)
6

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.

More from data-apis/array-api-compat

All issues in data-apis/array-api-compat

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.