On Mon, Jan 31, 2022 at 4:03 PM Petr Viktorin <encu...@gmail.com> wrote: > > If we change the stable ABI, I would prefer to fix multiple issues at > > once. Examples: > > > > * No longer return borrowed references (ex: PyDict_GetItem is part of > > the stable ABI) and no longer steal references (ex: > > PyModule_AddObject) > > > > * Disallow getting direct access into an object data without a > > function to "release" the data. For example, PyBytes_AsString() gives > > a direct access into the string, but Python doesn't know when the C > > extension is done with it, and when it's safe to delete the object. > > Such API prevents to move Python objects in memory (implement a moving > > garbage collector in Python). > > > > * Disallow dereferencing a PyObject* pointer: most structures must be > > opaque. It indirectly means that accessing directly structure members > > must also be disallowed. PEP 670 and PEP 674 are partially fixing the > > issues. > > (...) fixing these in the API first is probably the way to go.
That's what I already did in the past and what I plan to do in the future. Victor -- 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/JYZFBZPHBYNOR7RZXLFFEHL7WZGNY5EA/ Code of Conduct: http://python.org/psf/codeofconduct/