Skip to content

Commit f6ff925

Browse files
rwgkcopybara-github
authored andcommitted
Systematically change _ to const_name in pybind11_abseil, pybind11_protobuf.
This is a functional no-op. Note that `_` was deprecated already in Dec 2021 (pybind/pybind11#3423). PiperOrigin-RevId: 575085924
1 parent 6c181d3 commit f6ff925

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

pybind11_abseil/absl_casters.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ struct type_caster<absl::Span<T>> {
459459
return *this;
460460
}
461461

462-
static constexpr auto name = _("Span[") + make_caster<T>::name + _("]");
462+
static constexpr auto name =
463+
const_name("Span[") + make_caster<T>::name + const_name("]");
463464

464465
// We do not allow moving because 1) spans are super lightweight, so there's
465466
// no advantage to moving and 2) the span cannot exist without the caster,

pybind11_abseil/status_caster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct type_caster<google::NoThrowStatus<StatusType>> {
5252
template <>
5353
struct type_caster<absl::Status> : public type_caster_base<absl::Status> {
5454
public:
55-
static constexpr auto name = _("None");
55+
static constexpr auto name = const_name("None");
5656
// Convert C++ -> Python.
5757
static handle cast(const absl::Status* src, return_value_policy policy,
5858
handle parent, bool throw_exception = true) {

pybind11_abseil/statusor_caster.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ namespace detail {
2020
template <typename PayloadType>
2121
struct NoThrowStatusType<absl::StatusOr<PayloadType>> {
2222
using NoThrowAbslStatus = type_caster_base<absl::Status>;
23-
static constexpr auto name = _("Union[") + NoThrowAbslStatus::name + _(", ") +
24-
make_caster<PayloadType>::name + _("]");
23+
static constexpr auto name = const_name("Union[") + NoThrowAbslStatus::name +
24+
const_name(", ") +
25+
make_caster<PayloadType>::name + const_name("]");
2526
};
2627

2728
// Convert absl::StatusOr<T>.

0 commit comments

Comments
 (0)