From a0f5bbcfb71a28cd3eaa308250af63a0889a1c85 Mon Sep 17 00:00:00 2001 From: vfdev Date: Tue, 7 Jan 2025 16:33:01 +0100 Subject: [PATCH] Fixed typo in dunder get/set methods in PyAttrBuilderMap (#121794) Description: - fixed a typo in the method name: dunde -> dunder --- mlir/lib/Bindings/Python/IRCore.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp index 05c000bfd8ca0a..453d4f7c7e8bca 100644 --- a/mlir/lib/Bindings/Python/IRCore.cpp +++ b/mlir/lib/Bindings/Python/IRCore.cpp @@ -272,13 +272,13 @@ struct PyAttrBuilderMap { static bool dunderContains(const std::string &attributeKind) { return PyGlobals::get().lookupAttributeBuilder(attributeKind).has_value(); } - static nb::callable dundeGetItemNamed(const std::string &attributeKind) { + static nb::callable dunderGetItemNamed(const std::string &attributeKind) { auto builder = PyGlobals::get().lookupAttributeBuilder(attributeKind); if (!builder) throw nb::key_error(attributeKind.c_str()); return *builder; } - static void dundeSetItemNamed(const std::string &attributeKind, + static void dunderSetItemNamed(const std::string &attributeKind, nb::callable func, bool replace) { PyGlobals::get().registerAttributeBuilder(attributeKind, std::move(func), replace); @@ -287,8 +287,8 @@ struct PyAttrBuilderMap { static void bind(nb::module_ &m) { nb::class_(m, "AttrBuilder") .def_static("contains", &PyAttrBuilderMap::dunderContains) - .def_static("get", &PyAttrBuilderMap::dundeGetItemNamed) - .def_static("insert", &PyAttrBuilderMap::dundeSetItemNamed, + .def_static("get", &PyAttrBuilderMap::dunderGetItemNamed) + .def_static("insert", &PyAttrBuilderMap::dunderSetItemNamed, "attribute_kind"_a, "attr_builder"_a, "replace"_a = false, "Register an attribute builder for building MLIR " "attributes from python values.");