[Mlir-commits] [mlir] [mlir][python] Disable pytype not-yet-supported error on Buffer import (PR #189440)

Jackson Stogel llvmlistbot at llvm.org
Mon Mar 30 11:00:10 PDT 2026


https://github.com/jtstogel created https://github.com/llvm/llvm-project/pull/189440

For pyhon versions <3.12, pytype complains that:

```
error: in <module>: collections.abc.Buffer not supported yet [not-supported-yet]
  from collections.abc import Buffer as _Buffer
```

Since it seems like this code intends to support <3.12, disabling the type error on this line.

>From 880a9e04ccaa95c826b7ad748d6b9e0ebe772e2a Mon Sep 17 00:00:00 2001
From: jtstogel <jtstogel at google.com>
Date: Mon, 30 Mar 2026 10:55:11 -0700
Subject: [PATCH] [mlir][python] Disable pytype not-yet-supported error on
 Buffer import

---
 mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
index 14c76295daaee..14500edca5bcf 100644
--- a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
@@ -49,7 +49,7 @@ import builtins
 from typing import Any as _Any, Sequence as _Sequence, Union as _Union, Optional as _Optional
 import sys as _sys
 if _sys.version_info >= (3, 12):
-  from collections.abc import Buffer as _Buffer
+  from collections.abc import Buffer as _Buffer  # pytype: disable=not-supported-yet
 else:
   try:
     from typing_extensions import Buffer as _Buffer



More information about the Mlir-commits mailing list