Details
Description
Deprecating a C++ function wrapped with pybind11 currently requires a pure-Python file to be added so deprecate_pybind11 can be used on the wrapped function. This is an unfortunate amount of boilerplate for something we want to keep lightweight, and it also ensures that a deprecation warning is still emitted when compiling the pybind11 module.
It should be possible to have a pure-C++ way to invoke deprecate_pybind11 (i.e. by importing it using pybind11 APIs) while squashing compiler warnings. The latter may require that this be a macro - we'll see - but that's a price worth paying to avoid spurious compiler warnings.
Kian-Tat Lim, before I spend any time on this, did you try anything like this when putting together deprecate_pybind11?
Attachments
Issue Links
- mentioned in
-
Page Loading...
Leaving the side the question of whether we want to suppress warnings from pybind11 wrappers, last I checked (~a year ago) GCC's warning-suppression #pragma s were broken, and had been for over a major version at that point. So it may not be possible to do this completely.