[issue39471] Meaning and clarification of PyBuffer_Release()

2020-04-22 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue39471] Meaning and clarification of PyBuffer_Release()

2020-04-22 Thread Sebastian Berg
Sebastian Berg added the comment: Ok, I will just close it. It is painfully clear that e.g. `mmap` uses it this way to prohibit closing, and also `memoryview` has all the machinery necessary to do counting of how many exports, etc. exists. I admit, this still rubs me the wrong way, and I thi

[issue39471] Meaning and clarification of PyBuffer_Release()

2020-01-27 Thread Eric Wieser
Change by Eric Wieser : -- nosy: +Eric Wieser ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue39471] Meaning and clarification of PyBuffer_Release()

2020-01-27 Thread Sebastian Berg
Sebastian Berg added the comment: I went through Python, `array` seems to not break the logic. pickling has a comment which specifically wants to run into the argument parsing corner case above (I am not sure that it is really important). However, `Modules/_testbuffer.c` (which is just test)

[issue39471] Meaning and clarification of PyBuffer_Release()

2020-01-27 Thread Sebastian Berg
Sebastian Berg added the comment: Hmmm, it seems I had missed this chunk of PEP 3118 before: > Exporters will need to define a bf_releasebuffer function if they can > re-allocate their memory, strides, shape, suboffsets, or format variables > which they might share through the struct bufferi

[issue39471] Meaning and clarification of PyBuffer_Release()

2020-01-27 Thread Sebastian Berg
New submission from Sebastian Berg : The current documentation of ``PyBuffer_Release()`` and the PEP is a bit fuzzy about what the function can and cannot do. When an object exposes the buffer interface, I believe it should always return a `view` (in NumPy speak) of its own data, i.e. the dat