Skip to content

MAINT: drop support for PyPy #30416

Closed

Description

@mattip

PyPy is no longer under active development development has slowed down, and has not released a Python3.12 version. Other than the submodule pythoncapi_compat.h, we maintain code that checks IS_PYPY

  • implementation-specific details, like ctypes.__mro__, object identity vs. value-based equality, the whole elidation feature to optimize a + b + c, and PyTuple_GET_ITEM macros
  • missing functionality like PyErr_FormatV
  • refcounting differences like in np.resize() (it can be argued this is unreliable on CPython >= 3.14) and tracking accesses to mmap
  • PyPy cannot modify tp_doc after PyType_Ready (it can be argued CPython should not allow this either)
  • No support for limited-api on PyPy (nor on CPython3.14t)
  • PyPy does not break complicated reference cycles involving both Python and c-extensions
  • lack of sys.getsizeof on PyPy (and arguably this is inaccurate on CPython with a JIT)
  • Different priority of sq_concat and nb_add when both are defined
  • Some differences with __signature__ that may be cleaned up on 2.5, which does not support Python3.11
  • Some typing stub differences

Should we remove some or all of the PyPy-specific work-arounds?

Edit (mattip 01.10.2026): rephrased the opening line.

Activity

  1. ngoldbaum commented on Dec 11, 2025

    @ngoldbaum
    Member

    My worry about keeping all the pypy-specific code in-tree is that people will cargo cult it and it will likely be broken (obviously or subtly) without any testing. It's also very likely IMO that in-tree pypy support will bitrot - probably more quickly than Python 3.11 support in general.

    That said, code churn for code churn's sake is never good. What do you think Matti? Is keeping some of the pypy support code around worth it?

  2. mhvk commented on Dec 11, 2025

    @mhvk
    Contributor

    Has there been any contact with pypy? (from the website, [email protected]?). If there is a claim that higher python version support is "any day now", then perhaps worth waiting or giving a grace period. Otherwise, I think it is best to just remove it all, as without testing it is indeed guaranteed to break.

  3. da-woods commented on Dec 11, 2025

    @da-woods
    Contributor

    Has there been any contact with pypy?

    I think Matti is the contact with PyPy here

  4. mhvk commented on Dec 11, 2025

    @mhvk
    Contributor

    OK, if there is essentially certainty about "no longer under active development", then my inclination would be to remove the work-arounds, even if some of them arguably affect regular CPython too. In particular, I think at times it hinders us in using newer CPython features that help being thread-safe, etc. Plus I'd not discount just the mental load of seeing different paths.

  5. seberg commented on Dec 11, 2025

    @seberg
    Member

    Removing them seems nicest. If we care, maybe a single PR could be nice so it's easy to find them if anyone is ever curios?

  6. mattip commented on Dec 12, 2025

    @mattip
    MemberAuthor

    I agree that the PyPy conditional compilation in the source code can be removed, maybe related to #28800 to deprecate np.resize.

    On looking at the changes to arr_add_docstring, I think that the PyPy skips are bogus and can be removed even with PyPy since we now set the docstrings in the __dict__.__doc__.

    Some of the refcounting/gc test paths might be needed in the future, if not with CPython3.15 then with a future version. Perhaps the condition could be more specific, i.e. instead of IS_PYPY, to the negative of SUPPORTS_REFCOUNT, and HAS_GETSIZEOF.

  7. mhvk commented on Dec 12, 2025

    @mhvk
    Contributor

    I don't have a strong opinion, but my tendency would be to remove anything that we cannot test (which can include 3.15-dev, of course). My sense would be that if refcounting becomes optional, there will be suggested paths to move towards that, and we might as well follow those if they come, instead of hanging on to work-arounds that might not work anyway. But again, a sense rather than a well-informed opinion!

  8. konstin commented on Jan 21, 2026

    @konstin

    Is there any from the PyPy project itself, e.g. on https://pypy.org or the PyPy blog, that we can link people to? I don't think users are otherwise aware that PyPy is losing ecosystem support.

  9. added a commit that references this issue on Jan 21, 2026
  10. mattip commented on Jan 21, 2026

    @mattip
    MemberAuthor

    The ongoing discussion around PyPy3.12 in github is probably the best source of the prevailing sentiment from PyPy.

    my tendency would be to remove anything that we cannot test

    Makes sense, but the remaining clauses are the opposite: skipping tests or parts of tests that will fail with other interpreters.

  11. stuaxo commented on Mar 8, 2026

    @stuaxo

    PyPy will always be a few versions behind CPython, 3.12 will arrive though

  12. added a commit that references this issue on Aug 16, 2026
  13. johnthagen commented on Oct 1, 2026

    @johnthagen
    Contributor

    @mattip I see you recently released PyPy 3.12, which makes it feel like PyPy is still under active development?

    Do you have any up-to-date insights here?

  14. seberg commented on Oct 1, 2026

    @seberg
    Member

    See #32332

  15. ngoldbaum commented on Oct 1, 2026

    @ngoldbaum
    Member

    See #32332

    edit: jinx!

  16. added a commit that references this issue on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions