[BUG]: Documentation missing how to use py::nodelete with shared_holder progressive mode
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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