This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients ZackerySpytz, espie, petr.viktorin, rhettinger, serhiy.storchaka, skrah, vstinner
Date 2020-12-10.13:18:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1607606297.33.0.0333816817704.issue30459@roundup.psfhosted.org>
In-reply-to
Content
> This change goes directly against PEP 387.

The change respects the documentation which always documented the result type as "void".

3.10: https://docs.python.org/dev/c-api/tuple.html#c.PyTuple_SET_ITEM
3.5: https://docs.python.org/3.5/c-api/tuple.html#c.PyTuple_SET_ITEM
2.7: https://docs.python.org/2.7/c-api/tuple.html#c.PyTuple_SET_ITEM

This change is backward incompatible on purpose: it's to implement the documented behavior, and the macro was misused leading to a bug: "PyList_SET_ITEM (l, i, obj) < 0" in py-qt4.

I would also prefer a deprecation warning, but I don't see how do detect when a macro is abused to write "x = SET();" or "SET() = x;" Maybe a C linter could detect that, but I don't know any tool doing that.

The best we can do is to announce the change. That's why I documented in What's New in Python 3.10, and not only "hidden" in the Changelog:
https://docs.python.org/dev/whatsnew/3.10.html#id2

My expectation is that apart py-qt4, no project abuse these 3 macros.
History
Date User Action Args
2020-12-10 13:18:17vstinnersetrecipients: + vstinner, rhettinger, petr.viktorin, skrah, serhiy.storchaka, espie, ZackerySpytz
2020-12-10 13:18:17vstinnersetmessageid: <1607606297.33.0.0333816817704.issue30459@roundup.psfhosted.org>
2020-12-10 13:18:17vstinnerlinkissue30459 messages
2020-12-10 13:18:17vstinnercreate