[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

Serhiy Storchaka report at bugs.python.org
Fri Jan 27 04:49:13 EST 2017


Serhiy Storchaka added the comment:

The converter for the format parameter already exists. It is cache_struct(). You just need to change its interface.

> * Fix Struct.__init__() error message: the method accepts also Unicode
> * Document that Struct accepts str encodable to ASCII and bytes

I think this should be backported to older versions. Maybe there is an open issue for this.

> I would be nice to use Py_buffer format for the "buffer" argument of iter_unpack(), but Argument Clinic calls PyBuffer_Release(&buffer), whereas the buffer should stay alive after the function exit. Is there a way to clone/copy a Py_buffer?

I agreed that the Py_buffer converter is not applicable here. Just object is good.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29300>
_______________________________________


More information about the Python-bugs-list mailing list