A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-October/009968.html below:

[Python-Dev] Wierd buffer "add" behaviour.

[Python-Dev] Wierd buffer "add" behaviour. [Python-Dev] Wierd buffer "add" behaviour.Thomas Heller thomas.heller@ion-tof.com
Mon, 16 Oct 2000 11:14:49 +0200
IMHO, the whole buffer interface is weird.

- Only the Buffer_FromObject() function is exposed to the python
level (as buffer()), the other functions are missing. This
means that one could only use the buffer interface in
extension modules. Was this intentional?

- No way a python class can expose the buffer interface

- There is a bug in the buffer interface (which
prevented recently that I could use buffer objects
at all, I had to implement my own)

PyObject *base = PyBuffer_New(100);
PyObject *buffer = PyBuffer_FromObject(base, 0, 100);
Py_DECREF(base);

After this code is executed,
buffer points to deallocated memory (because
buffer does not hold a reference to base anymore).

(Guido classified this as a wish, but at least
it contradicts the documentation)

Thomas




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4