Skip to content

[BUG]: pybind11 3.0.0 uses deprecated numpy.bool dtype #5847

Open

Description

@dyollb

Required prerequisites

What version (or hash if on master) of pybind11 are you using?

3.0.0

Problem description

pybind11 3.0.0 uses deprecated numpy.bool dtype.

This type is deprecated since numpy==1.2.0: bool should be used instead (see here)

This was also mentioned in this pybind11-stubgen PR pybind/pybind11-stubgen#263

Reproducible example code


Is this a regression? Put the last known working version here if it is.

Yes

Activity

  1. added
    triage
    on Sep 23, 2025
  2. InvincibleRMC commented on Sep 26, 2025

    @InvincibleRMC
    Contributor

    Looking at the documentation the minimum supported numpy is 1.7+ and the deprecations happen in 1.20. Now this may no longer be accurate since the oldest version I could find in CI is 1.21.6. I would gladly update the types when either the minimum version is bumped to 1.20 in the docs or if numpy actually winds up removing the types at runtime.

    https://github.com/pybind/pybind11/blob/30748f863f18c2e0d48e9dcb3be1e77542904da8/docs/advanced/pycpp/numpy.rst?plain=1#L151C1-L156C59 #

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

    triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions