Add Python 3.10 support: use Py_SET_SIZE() by vstinner · Pull Request #52 · MagicStack/immutables

Conversation

@vstinner

Run upgrade_pythoncapi.py on immutables: replace Py_SIZE(node)=size
with Py_SET_SIZE(node, size).

Add pythoncapi_compat.h header file to support Python 3.8 and older.

Fix #46

Run upgrade_pythoncapi.py on immutables: replace Py_SIZE(node)=size
with Py_SET_SIZE(node, size).

Add pythoncapi_compat.h header file to support Python 3.8 and older.

Fix #46

@vstinner

1st1

@@ -1,4 +1,5 @@
#include <stddef.h> /* For offsetof */
#include "pythoncapi_compat.h"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means we need to drop support for Python 3.5, right?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.5 was already supported by I was too lazy to port the tests to Python 3.5. Since I'm trying to use pythoncapi_compat.h on Mercurial which still supports Python 2.7, I ported it to Python 2.7, 3.4 and 3.5. And 2.7 and 3.5 are now tested on the project CI.

@1st1

@vstinner

Thanks Victor!

You're welcome, thanks for the review. immutables is now the first official user of pythoncapi_compat.h :-D

2 participants

@vstinner @1st1