[Mlir-commits] [mlir] [mlir][python] value casting (PR #69644)

Maksim Levental llvmlistbot at llvm.org
Mon Oct 30 12:26:17 PDT 2023


================
@@ -231,7 +231,7 @@ class Sliceable {
   /// Returns the element at the given slice index. Supports negative indices
   /// by taking elements in inverse order. Returns a nullptr object if out
   /// of bounds.
-  pybind11::object getItem(intptr_t index) {
+  virtual pybind11::object getItem(intptr_t index) {
----------------
makslevental wrote:

This isn't for RTTI, this is purely so that `OpResultList` and `OpBlockArgumentList` can do something different from e.g. what `PyAffineMapExprList` does. Namely `OpResultList::getItem` and `BlockArgumentList::getItem` call `item.attr(MLIR_PYTHON_MAYBE_DOWNCAST_ATTR)()`.

https://github.com/llvm/llvm-project/pull/69644


More information about the Mlir-commits mailing list