8000 [mypyc] Fix bytes join on Python 3.13 by JukkaL · Pull Request #17527 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@JukkaL
Copy link
Collaborator
@JukkaL JukkaL commented Jul 14, 2024

CPython 3.13 no longer has _PyBytes_Join or _PyObject_CallMethodIdOneArg.

Work on mypyc/mypyc#1056.

`_PyBytes_Join` is no longer available.

Work on mypyc/mypyc#1056.
@cdce8p
Copy link
Collaborator
cdce8p commented Jul 14, 2024

FYI the current plan is to restore _PyBytes_Join for 3.13 and make it public in 3.14. See python/cpython#121646 (comment)

if (method == NULL) {
return NULL;
}
PyObject *res = PyObject_VectorcallMethod(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This might fail with 3.8. PyObject_VectorcallMethod was provisional there. The leading underscore was removed in 3.9. _PyObject_VectorcallMethod is available as alias in 3.13 for backwards compatibility.

Copy link
Collaborator
@hauntsaninja hauntsaninja Jul 27, 2024

Choose a reason for hiding this comment

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

This is guarded by CPY_3_13_FEATURES so should be fine on that front, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

True, missed that. Although now _PyBytes_Join doesn't need to be fixed for 3.13 anymore. See python/cpython#122287

@cdce8p
Copy link
Collaborator
cdce8p commented Jul 25, 2024

_PyBytes_join will be exported again in 3.13. We can probably close this one as it's no longer necessary. python/cpython#122287

@JukkaL
Copy link
Collaborator Author
JukkaL commented Aug 18, 2024

Yes, this is no longer needed on 3.13.0rc1.

@JukkaL JukkaL closed this Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0