8000 Merge pull request #26989 from ngoldbaum/fix-ctypes-example · numpy/numpy@495fe43 · GitHub
[go: up one dir, main page]

Skip to content

Commit 495fe43

Browse files
authored
Merge pull request #26989 from ngoldbaum/fix-ctypes-example
DOC: fix ctypes example
2 parents 472b938 + de8528b commit 495fe43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numpy/ctypeslib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,17 +503,17 @@ def as_ctypes_type(dtype):
503503
--------
504504
Converting a simple dtype:
505505
506-
>>> dt = np.dtype('i4')
506+
>>> dt = np.dtype('int8')
507507
>>> ctype = np.ctypeslib.as_ctypes_type(dt)
508508
>>> ctype
509-
<class 'ctypes.c_int32'>
509+
<class 'ctypes.c_byte'>
510510
511511
Converting a structured dtype:
512512
513513
>>> dt = np.dtype([('x', 'i4'), ('y', 'f4')])
514514
>>> ctype = np.ctypeslib.as_ctypes_type(dt)
515515
>>> ctype
516-
<class 'ctypes.Structure'>
516+
<class 'struct'>
517517
518518
"""
519519
return _ctype_from_dtype(_dtype(dtype))

0 commit comments

Comments
 (0)
0