[Python-Dev] Deleting with setting C API functions

Random832 random832 at fastmail.com
Wed Dec 2 09:40:55 EST 2015


On 2015-12-02, M.-A. Lemburg <mal at egenix.com> wrote:
> A first step would be to replace the macro with a proper function
> to avoid false positive warnings, even when using the correct API.
>
> Then we could add a warning to the PyObject_SetAttr() function and
> hope that not too many projects use the stable ABI as basis to
> have C extensions work across several releases.

How about using a versioned ABI? Make a new function that
doesn't allow NULL, called something like PyObject_SetAttr2, and
instead of declaring the old one in headers, use a #define to
the new name.

> Overall, I'm not sure whether it's worth the trouble. Documenting
> the feature and adding a deprecation notice to just the documentation
> would likely be better. We could then remove the functionality
> in Python 4.

Are there plans for a Python 4?



More information about the Python-Dev mailing list