New submission from Memeplex:

This real life example is pretty terrible:

(ct.c_float * self._nfeats).from_address(
   ct.addressof(self._vals.contents))

The alternative of casting the pointer to pointer-to-array, then pick 
ptr.contents is not really better.

What about a from_pointer(ptr) method? Or overloading from_address to take a 
pointer? Or a simple shortcut to get the address pointed to by a pointer 
(related: https://bugs.python.org/issue26565).

I think this part of ctypes api needs to get more concise and pythonic.

----------
components: ctypes
messages: 267951
nosy: memeplex
priority: normal
severity: normal
status: open
title: [ctypes] Allow from_pointer creation
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27274>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to