From a6ffbe35c4856782d7b54ac38aafb99975d96c32 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Thu, 19 Dec 2024 13:48:17 -0800 Subject: [PATCH] clang tidy --- include/pybind11/cast.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index d4ae36c8f7..69fc0bada7 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -1367,7 +1367,7 @@ object object_or_cast(T &&o) { } // This is being used to get around the conflict with the deprecated str() function on object_api -typedef str py_str; +using py_str = str; // Declared in pytypes.h: // Written here so make_caster can be used @@ -1380,7 +1380,7 @@ obj_attr_accessor object_api::attr_with_type_hint(handle key) const { "https://en.cppreference.com/w/cpp/language/static#Static_data_members"); #endif object ann = annotations(); - object reinterpreted_key = reinterpret_borrow(key); + auto reinterpreted_key = reinterpret_borrow(key); if (ann.contains(reinterpreted_key)) { throw std::runtime_error("__annotations__[\"" + std::string(py_str(reinterpreted_key)) + "\"] was set already.");