pybind / pybind/pybind11

[BUG]: Documentation missing how to use py::nodelete with shared_holder progressive mode

Open
#3,182 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

Required prerequisites
Problem description

If i use py::class<MyClass,std::unique_ptr<MyClass,py::nodelete>> I get a compile time error that I should put PYBIND11_TYPE_CASTER_BASE_HOLDER(MyClass,std::unique_ptr<MyClass>) somewhere, should I also put pybind11::nodelete there as well ? I am not sure, should I even be using unique_ptr at all ? I've not seen how to add py::nodelete to the py::smart_holder as it has no template args

Reproducible example code
py::class<MyClass,std::unique_ptr<MyClass,py::nodelete>>

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 with the linked pybind11 documentation and the reproducible py::class<MyClass, std::unique_ptr<MyClass, py::nodelete>> example. Determine how py::nodelete should be used with shared_holder progressive mode and whether PYBIND11_TYPE_CASTER_BASE_HOLDER is required, then document the supported usage and clarify whether unique_ptr or smart_holder is appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 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.