[QUESTION] De-deprecation of direct call to module constructor
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
We explicitely use the module constructor instead of the macro in xeus-python, and got the deprecation warning:
warning: 'pybind11::module_::module_(const char*, const char*)' is deprecated: Use PYBIND11_MODULE or module_::create_extension_module instead [-Wdeprecated-declarations]
Replacing
py::module foobar_module("foobar");
with
py::module foobar_module = py::module_::create_extension_module("foobar", nullptr, new py::module_::module_def);
fixes it, but we find it a bit too verbose. Why not allowing direct calls to the constructor?
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
Begin with pybind11::module_::module_ and module_::create_extension_module, comparing them with PYBIND11_MODULE. Determine whether direct constructor calls should remain supported without the deprecation warning, and document the decision or acceptance criteria; no files or tests are named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100