diff --git a/include/pybind/cast.h b/include/pybind/cast.h index 05e8fe1a0..b7c6558db 100644 --- a/include/pybind/cast.h +++ b/include/pybind/cast.h @@ -104,7 +104,7 @@ template class type_caster { public: typedef instance instance_type; - static descr descr() { return typeid(type); } + static descr name() { return typeid(type); } type_caster() { auto const& registered_types = get_internals().registered_types; @@ -211,7 +211,7 @@ protected: protected: \ type value; \ public: \ - static descr descr() { return py_name; } \ + static descr name() { return py_name; } \ static PyObject *cast(const type *src, return_value_policy policy, PyObject *parent) { \ return cast(*src, policy, parent); \ } \ @@ -328,7 +328,7 @@ public: return PyUnicode_DecodeLatin1(str, 1, nullptr); } - static descr descr() { return "str"; } + static descr name() { return "str"; } operator char*() { return value; } operator char() { return *value; } @@ -361,11 +361,11 @@ public: return tuple; } - static descr descr() { + static descr name() { class descr result("("); - result += std::move(type_caster::type>::descr()); + result += std::move(type_caster::type>::name()); result += ", "; - result += std::move(type_caster::type>::descr()); + result += std::move(type_caster::type>::name()); result += ")"; return result; } @@ -391,9 +391,9 @@ public: return cast(src, policy, parent, typename make_index_sequence::type()); } - static descr descr(const char **keywords = nullptr, const char **values = nullptr) { - std::array descrs {{ - type_caster::type>::descr()... + static descr name(const char **keywords = nullptr, const char **values = nullptr) { + std::array names {{ + type_caster::type>::name()... }}; class descr result("("); for (int i=0; i>::descr() + detail::descr(" -> ") + - type_caster::type>::descr() + + type_caster>::name() + detail::descr(" -> ") + + type_caster::type>::name() + detail::descr(">")); }; diff --git a/include/pybind/pybind.h b/include/pybind/pybind.h index 45c716c83..f2d366a6f 100644 --- a/include/pybind/pybind.h +++ b/include/pybind/pybind.h @@ -190,9 +190,9 @@ public: process_extras(((capture *) entry->data)->extras, entry, kw.data(), def.data()); - detail::descr d = cast_in::descr(kw.data(), def.data()); + detail::descr d = cast_in::name(kw.data(), def.data()); d += " -> "; - d += std::move(cast_out::descr()); + d += std::move(cast_out::name()); initialize(entry, d, sizeof...(Arg)); } @@ -247,9 +247,9 @@ private: std::array kw{}, def{}; process_extras(((capture *) entry->data)->extras, entry, kw.data(), def.data()); - detail::descr d = cast_in::descr(kw.data(), def.data()); + detail::descr d = cast_in::name(kw.data(), def.data()); d += " -> "; - d += std::move(cast_out::descr()); + d += std::move(cast_out::name()); initialize(entry, d, sizeof...(Arg)); } diff --git a/include/pybind/stl.h b/include/pybind/stl.h index 36568a056..4b935cfae 100644 --- a/include/pybind/stl.h +++ b/include/pybind/stl.h @@ -54,7 +54,7 @@ public: } return list; } - PYBIND_TYPE_CASTER(type, detail::descr("list<") + value_conv::descr() + detail::descr(">")); + PYBIND_TYPE_CASTER(type, detail::descr("list<") + value_conv::name() + detail::descr(">")); }; template struct type_caster> { @@ -97,7 +97,7 @@ public: return dict; } - PYBIND_TYPE_CASTER(type, detail::descr("dict<") + key_conv::descr() + detail::descr(", ") + value_conv::descr() + detail::descr(">")); + PYBIND_TYPE_CASTER(type, detail::descr("dict<") + key_conv::name() + detail::descr(", ") + value_conv::name() + detail::descr(">")); }; inline std::ostream &operator<<(std::ostream &os, const object &obj) { os << (const char *) obj.str(); return os; }