New submission from Thomas Heller <[EMAIL PROTECTED]>: This patch implements a .from_buffer(source, offset=0) class method from ctypes types. 'source' must expose a writeable buffer interface; the created ctypes instance will share the internal buffer of the source object; also it holds a reference to the source object to keep it alive.
The usual problems with the buffer interface are not hidden. Open question: Should there be an additional 'copy_from_buffer' class method that accepts read-only buffer interface (as an alternative, an optional 'copy=False' parameter could be introduced)? ---------- assignee: theller components: ctypes files: from_buffer.patch keywords: patch, patch messages: 65620 nosy: theller severity: normal status: open title: Create ctypes instances from buffer interface versions: Python 2.6 Added file: http://bugs.python.org/file10057/from_buffer.patch __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2655> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com