Skip to content

feat: numpy scalars #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

feat: numpy scalars #24

wants to merge 15 commits into from

Conversation

henryiii
Copy link
Owner

Description

Suggested changelog entry:

@henryiii henryiii force-pushed the henryiii/feat/numpyscalars branch 3 times, most recently from 529c1e3 to 6870f27 Compare June 13, 2025 20:08
@henryiii henryiii force-pushed the henryiii/feat/numpyscalars branch from 6870f27 to 9e3752f Compare June 13, 2025 22:47
Rosdf and others added 8 commits June 14, 2025 08:38
* [docs] Add entry for warnings

* Fix code formatting

* Update docs

* Fix issue with docs

* [skip ci] Minor edits.

---------

Co-authored-by: Ralf W. Grosse-Kunstleve <[email protected]>
…r platforms like macOS). (pybind#5728)

* Revert PR pybind#5700 production code change (pybind11/detail/struct_smart_holder.h).

```
git checkout b194891~1 include/pybind11/detail/struct_smart_holder.h
```

* Introduce `get_internals().get_memory_guarded_delete()`

* [skip ci] Only pass around `memory::get_guarded_delete` function pointer.

* [skip ci] Change a variable name for internal consistency. Add 3 x NOTE: PYBIND11_INTERNALS_VERSION needs to be bumped if changes are made to this struct.

* Add comment: get_internals().get_memory_guarded_delete does not need with_internals()

* Traverse all DSOs to find memory::guarded_delete with matching RTTI.

* Add nullptr check to dynamic_cast overload.

Suggested by ChatGPT for these reasons:

* Prevents runtime RTTI lookups on nullptr.

* Helps avoid undefined behavior if users pass in nulls from failed casts or optional paths.

* Ensures consistent return value semantics and no accidental access to vtable.

* Improve smart_holder unique_ptr deleter compatibility checks across DSOs:

* Replace RTTI-based detection of std::default_delete<T> with a constexpr check to avoid RTTI reliance

* Add type_info_equal_across_dso_boundaries() fallback using type_info::name() for RTTI equality across macOS DSOs

* Rename related flags and functions for clarity (e.g., builtin → std_default)

* Improves ABI robustness and clarity of ownership checks in smart_holder

* Trivial renaming for internal consistency: builtin_delete → std_default_delete

* Add get_trampoline_self_life_support to detail::type_info (passes local testing).

* Polish previous commit slightly.

* [skip ci] Store memory::get_guarded_delete in `detail::type_info` instead of `detail::internals` (no searching across DSOs required).

* Revert change suggested by ChatGPT. After double-checking, ChatGPT agrees this isn't needed.

* Minor polishing.
…der` (pybind#5731)

* Add overload to enable `.def(py::init(&rtrn_shcp))`. Also uncomment `.def(py::init(&rtrn_uqcp))` and `.def(py::init(&rtrn_udcp))`, which happen to work already (not sure what change in the past made those work).

* Introduce `construct_from_shared_ptr()` helper for DRY-ness.
Co-authored-by: Steve R. Sun <[email protected]>
Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii force-pushed the henryiii/feat/numpyscalars branch from fdf2def to 8379d25 Compare June 17, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants