@@ -2,11 +2,12 @@ PEP: 818
22Title: Adding the Core of the Pyodide Foreign Function Interface to Python
33Author: Hood Chatham <roberthoodchatham at gmail.com>
44Sponsor: Łukasz Langa <lukasz at python.org>
5- Discussions-To: https://discuss.python.org/t/pep-818-upstreaming -the-pyodide-ffi/105530
5+ Discussions-To: https://discuss.python.org/t/pep-818-adding -the-core-of-the- pyodide-foreign-function-interface-to-python-2/109311
66Status: Draft
77Type: Standards Track
88Created: 10-Dec-2025
99Python-Version: 3.16
10+ Post-History: `05-Jan-2026 <https://discuss.python.org/t/pep-818-upstreaming-the-pyodide-ffi/105530 >`__
1011
1112Abstract
1213========
@@ -62,10 +63,8 @@ supporting ``urllib3``, ``aiohttp``, and ``httpx`` requires the foreign function
6263interface.
6364
6465In order to keep the length of this PEP reasonable, we focus on the "core" of
65- the foreign function interface. The following areas are left to future PEPs:
66-
67- 1. asyncio
68- 2. a JavaScript interface for managing the Python runtime
66+ the foreign function interface. The JavaScript interface for managing the Python
67+ runtime is left to a future pep.
6968
7069
7170Rationale
@@ -1545,6 +1544,28 @@ run on.
15451544How to Teach This
15461545=================
15471546
1547+ Pyodide has maintained a user guide for this foreign function interface for
1548+ several years, and the existing `Pyodide type translation documentation
1549+ <https://pyodide.org/en/stable/usage/type-conversions.html> `_ can be adapted to
1550+ form the basis of the CPython documentation.
1551+
1552+ We have substantial experience in teaching users how to use Pyodide and for the
1553+ most part they find it very intuitive. The main area that trips up users is
1554+ memory management of ``PyProxy `` objects. For this reason, we have taken special
1555+ care to design the memory management error messages to be actionable.
1556+
1557+
1558+ Change History
1559+ ==============
1560+
1561+ - 30-Sept-2026
1562+
1563+ - Reduced the amount of detail in the specification section.
1564+ - Added support for proxying and conversion of buffers.
1565+ - Added asyncio support, including an event loop, conversion between Python
1566+ and JavaScript awaitables, and deferred destruction for arguments to an
1567+ asynchronous JavaScript function called from Python.
1568+
15481569
15491570Reference Implementation
15501571========================
@@ -1555,7 +1576,7 @@ Pyodide, https://github.com/hoodmane/cpython/tree/js-ffi
15551576Acknowledgments
15561577===============
15571578
1558- Mike Droettboom, Roman Yurchak, Gyeongjae Choi, Andrea Giammarchi
1579+ Mike Droettboom, Roman Yurchak, Gyeongjae Choi, Andrea Giammarchi, Thorsten Beier
15591580
15601581Copyright
15611582=========
0 commit comments