summaryrefslogtreecommitdiff
path: root/numpy/ctypeslib.pyi
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-05-21 20:03:44 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2021-05-21 21:15:16 +0200
commit869243e50c5a607b792d5102bd0ce360c377e8eb (patch)
tree4e050cb9c15e4c4afa6369a45528f1290919e0eb /numpy/ctypeslib.pyi
parent7de0fa959e476900725d8a654775e0a38745de08 (diff)
downloadnumpy-869243e50c5a607b792d5102bd0ce360c377e8eb.tar.gz
ENH: Add a mypy plugin for inferring the precision of `np.ctypeslib.c_intp`
Diffstat (limited to 'numpy/ctypeslib.pyi')
-rw-r--r--numpy/ctypeslib.pyi9
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/ctypeslib.pyi b/numpy/ctypeslib.pyi
index 689ea4164..642017ba7 100644
--- a/numpy/ctypeslib.pyi
+++ b/numpy/ctypeslib.pyi
@@ -1,11 +1,12 @@
from typing import List, Type
-from ctypes import _SimpleCData
+
+# NOTE: Numpy's mypy plugin is used for importing the correct
+# platform-specific `ctypes._SimpleCData[int]` sub-type
+from ctypes import c_int64 as _c_intp
__all__: List[str]
-# TODO: Update the `npt.mypy_plugin` such that it substitutes `c_intp` for
-# a specific `_SimpleCData[int]` subclass (e.g. `ctypes.c_long`)
-c_intp: Type[_SimpleCData[int]]
+c_intp = _c_intp
def load_library(libname, loader_path): ...
def ndpointer(dtype=..., ndim=..., shape=..., flags=...): ...