From f6ff92551862273d368a758b5b75703dde1f0b9d Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 19 Oct 2023 20:50:55 -0700 Subject: [PATCH] Systematically change `_` to `const_name` in pybind11_abseil, pybind11_protobuf. This is a functional no-op. Note that `_` was deprecated already in Dec 2021 (https://github.com/pybind/pybind11/pull/3423). PiperOrigin-RevId: 575085924 --- pybind11_abseil/absl_casters.h | 3 ++- pybind11_abseil/status_caster.h | 2 +- pybind11_abseil/statusor_caster.h | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pybind11_abseil/absl_casters.h b/pybind11_abseil/absl_casters.h index ced970b..25dd7b0 100644 --- a/pybind11_abseil/absl_casters.h +++ b/pybind11_abseil/absl_casters.h @@ -459,7 +459,8 @@ struct type_caster> { return *this; } - static constexpr auto name = _("Span[") + make_caster::name + _("]"); + static constexpr auto name = + const_name("Span[") + make_caster::name + const_name("]"); // We do not allow moving because 1) spans are super lightweight, so there's // no advantage to moving and 2) the span cannot exist without the caster, diff --git a/pybind11_abseil/status_caster.h b/pybind11_abseil/status_caster.h index baedf59..088bc7c 100644 --- a/pybind11_abseil/status_caster.h +++ b/pybind11_abseil/status_caster.h @@ -52,7 +52,7 @@ struct type_caster> { template <> struct type_caster : public type_caster_base { public: - static constexpr auto name = _("None"); + static constexpr auto name = const_name("None"); // Convert C++ -> Python. static handle cast(const absl::Status* src, return_value_policy policy, handle parent, bool throw_exception = true) { diff --git a/pybind11_abseil/statusor_caster.h b/pybind11_abseil/statusor_caster.h index 60db981..4010133 100644 --- a/pybind11_abseil/statusor_caster.h +++ b/pybind11_abseil/statusor_caster.h @@ -20,8 +20,9 @@ namespace detail { template struct NoThrowStatusType> { using NoThrowAbslStatus = type_caster_base; - static constexpr auto name = _("Union[") + NoThrowAbslStatus::name + _(", ") + - make_caster::name + _("]"); + static constexpr auto name = const_name("Union[") + NoThrowAbslStatus::name + + const_name(", ") + + make_caster::name + const_name("]"); }; // Convert absl::StatusOr.