Skip to content

Commit

Permalink
Systematically change _ to const_name in pybind11_abseil, pybind1…
Browse files Browse the repository at this point in the history
…1_protobuf.

This is a functional no-op.

Note that `_` was deprecated already in Dec 2021 (pybind/pybind11#3423).

PiperOrigin-RevId: 575085924
  • Loading branch information
Ralf W. Grosse-Kunstleve authored and copybara-github committed Oct 20, 2023
1 parent 6c081a7 commit 24a1111
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pybind11_protobuf/enum_type_caster.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct enum_type_caster {
using base_caster = pybind11::detail::make_caster<T>;

public:
static constexpr auto name = pybind11::detail::_<EnumType>();
static constexpr auto name = pybind11::detail::const_name<EnumType>();

// cast converts from C++ -> Python
static pybind11::handle cast(EnumType src,
Expand Down
2 changes: 1 addition & 1 deletion pybind11_protobuf/proto_caster_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ struct proto_caster : public proto_caster_load_impl<ProtoType>,
using Loader::value;

public:
static constexpr auto name = pybind11::detail::_<ProtoType>();
static constexpr auto name = pybind11::detail::const_name<ProtoType>();

// cast converts from C++ -> Python
//
Expand Down
5 changes: 3 additions & 2 deletions pybind11_protobuf/wrapped_proto_caster.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct wrapped_proto_caster : public pybind11_protobuf::proto_caster_load_impl<
using pybind11_protobuf::native_cast_impl::cast_impl;

public:
static constexpr auto name = pybind11::detail::_<WrappedProtoType>();
static constexpr auto name = pybind11::detail::const_name<WrappedProtoType>();

// cast converts from C++ -> Python
static pybind11::handle cast(WrappedProtoType src,
Expand Down Expand Up @@ -244,7 +244,8 @@ template <typename ProtoType>
struct wrapped_proto_vector_caster {
static constexpr auto name =
(pybind11::detail::const_name("List[") +
pybind11::detail::_<ProtoType>() + pybind11::detail::const_name("]"));
pybind11::detail::const_name<ProtoType>() +
pybind11::detail::const_name("]"));

// cast converts from Python -> C++
bool load(pybind11::handle src, bool convert) {
Expand Down

0 comments on commit 24a1111

Please sign in to comment.