BUG: Numpy does not recognize 'c' as PEP 3118 buffer format string
See original GitHub issueOne way to demonstrate the bug without writing a C extension is
>>> np.core._internal._dtype_from_pep3118('c')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "numpy/core/_internal.py", line 446, in _dtype_from_pep3118
raise ValueError("Unknown PEP 3118 data type specifier %r" % spec)
ValueError: Unknown PEP 3118 data type specifier 'c'
http://legacy.python.org/dev/peps/pep-3118/#additions-to-the-struct-string-syntax
http://docs.python.org/2/library/struct.html#format-characters
Issue Analytics
- State:
- Created 10 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
PEP 3118 warning when using ctypes array as numpy array
It's a bug in Python. ctypes currently produces invalid PEP 3118 type codes ... is present, Numpy skips using the PEP 3118 buffer...
Read more >[BUG] numpy implements PEP-3118 incorrectly #9456 - GitHub
PEP 3118 describes Buffers protocol to implement data interchange between different Python/C objects. I'm implementing such an object, ...
Read more >PEP 3118 – Revising the buffer protocol
This function returns 0 on success and -1 on failure (and raises an error). The first variable is the “exporting” object.
Read more >The array interface protocol — NumPy v1.25.dev0 Manual
This page describes the NumPy-specific API for accessing the contents of a NumPy array from other C extensions. PEP 3118 – The Revised...
Read more >2.2. Advanced NumPy - Scipy Lecture Notes
Recently added features, and what's in them: PEP 3118 buffers, ... x is a string (in Python 3 a bytes), we can represent...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No super easy way. What I did was look at the blame of the file in question on GitHub. I knew what the fix would look like, so found the relevant like, and clicked on the commit sha1 that blame shows beside it. When looking at a commit, GitHub shows the PR it was part of, which is how I found that number.
@eric-wieser Again, I thank you for this information. It sounds as if I could also do some tracing through the Pull Request meta data and find it that way. You’ve put me on to learning something else new within github: tracing changes… This is fun; hope to see you again as I go along on my journey. I take it you’re active on the numpy project…