@@ -2,11 +2,14 @@ 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 >`__,
11+ `01-Oct-2026 <https://discuss.python.org/t/pep-818-adding-the-core-of-the-pyodide-foreign-function-interface-to-python-2/109311 >`__
12+
1013
1114Abstract
1215========
@@ -62,10 +65,8 @@ supporting ``urllib3``, ``aiohttp``, and ``httpx`` requires the foreign function
6265interface.
6366
6467In 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
68+ the foreign function interface. The JavaScript interface for managing the Python
69+ runtime is left to a future PEP.
6970
7071
7172Rationale
@@ -1545,6 +1546,28 @@ run on.
15451546How to Teach This
15461547=================
15471548
1549+ Pyodide has maintained a user guide for this foreign function interface for
1550+ several years, and the existing `Pyodide type translation documentation
1551+ <https://pyodide.org/en/stable/usage/type-conversions.html> `__ can be adapted to
1552+ form the basis of the CPython documentation.
1553+
1554+ We have substantial experience in teaching users how to use Pyodide and for the
1555+ most part they find it very intuitive. The main area that trips up users is
1556+ memory management of ``PyProxy `` objects. For this reason, we have taken special
1557+ care to design the memory management error messages to be actionable.
1558+
1559+
1560+ Change History
1561+ ==============
1562+
1563+ - 30-Sept-2026
1564+
1565+ - Reduced the amount of detail in the specification section.
1566+ - Added support for proxying and conversion of buffers.
1567+ - Added asyncio support, including an event loop, conversion between Python
1568+ and JavaScript awaitables, and deferred destruction for arguments to an
1569+ asynchronous JavaScript function called from Python.
1570+
15481571
15491572Reference Implementation
15501573========================
@@ -1555,7 +1578,7 @@ Pyodide, https://github.com/hoodmane/cpython/tree/js-ffi
15551578Acknowledgments
15561579===============
15571580
1558- Mike Droettboom, Roman Yurchak, Gyeongjae Choi, Andrea Giammarchi
1581+ Mike Droettboom, Roman Yurchak, Gyeongjae Choi, Andrea Giammarchi, and Thorsten Beier.
15591582
15601583Copyright
15611584=========
0 commit comments