Hi Antoine,

In Python 3.4, I added "void PyMem_SetAllocator(PyMemAllocatorDomain
domain, PyMemAllocator *allocator)" to the public C API.

Problem: we wanted to add a new "calloc" field to PyMemAllocator structure.

I chose to rename the structure to PyMemAllocatorEx to ensure that all
C extensions using this function get a compilation error, rather than
leaving the new "calloc" field uninitialized. The function became:

"void PyMem_SetAllocator(PyMemAllocatorDomain domain, PyMemAllocatorEx
*allocator)"

I'm not sure what will be the new structure name when we will add new
fields (like malloc_aligned) :-(

For PyCodeOptions: does it contain posonlyargcount? If not, how do you
pass posonlyargcount. I'm not sure if you plan to handle the backward
compatibility.

Note: In the PEP 587, I added a private "_config_version" field to
PyConfig structure to prepare the structure to future extension, but
keep backward compatibility. The structure will be versionned ;-)

Victor

Le jeu. 13 juin 2019 à 01:08, Antoine Pitrou <solip...@pitrou.net> a écrit :
>
> On Wed, 12 Jun 2019 00:09:10 +0200
> Victor Stinner <vstin...@redhat.com> wrote:
> > Update.
> >
> > Le ven. 31 mai 2019 à 10:49, Petr Viktorin <encu...@gmail.com> a écrit :
> > > PEP 570 (Positional-Only Parameters) changed the signatures of
> > > PyCode_New() and types.CodeType(), adding a new argument for 
> > > "posargcount".
> >
> > Pablo proposed a PR to revert PyCode_New() API to Python 3.7 API:
> > https://github.com/python/cpython/pull/13959
> >
> > I dislike "PyCode_NewEx"  name, it will become worse when another
> > parameter will be added in the future. I prefer "With" naming. I
> > prefer "PyCode_NewWithPosArgs()" name.
>
> Or perhaps the alternative is a struct-based approach:
>
> typedef struct {
> // ...
> } PyCodeOptions;
>
> PyObject* PyCode_New(PyCodeOptions opts);
>
> ?
>
> Regards
>
> Antoine.
>
> _______________________________________________
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-dev@python.org/message/6K2R62CVNZXUZF3OCK6VVQIY3SD3KLBY/



-- 
Night gathers, and now my watch begins. It shall not end until my death.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/6OSS6VFDOPOVFBP5NEMVCZ5YN425TGBH/

Reply via email to