diff --git a/peps/pep-0818.rst b/peps/pep-0818.rst index 6eb478744f9..12fd5a6938a 100644 --- a/peps/pep-0818.rst +++ b/peps/pep-0818.rst @@ -2,11 +2,14 @@ PEP: 818 Title: Adding the Core of the Pyodide Foreign Function Interface to Python Author: Hood Chatham Sponsor: Ɓukasz Langa -Discussions-To: https://discuss.python.org/t/pep-818-upstreaming-the-pyodide-ffi/105530 +Discussions-To: https://discuss.python.org/t/pep-818-adding-the-core-of-the-pyodide-foreign-function-interface-to-python-2/109311 Status: Draft Type: Standards Track Created: 10-Dec-2025 Python-Version: 3.16 +Post-History: `05-Jan-2026 `__, + `01-Oct-2026 `__ + Abstract ======== @@ -62,10 +65,8 @@ supporting ``urllib3``, ``aiohttp``, and ``httpx`` requires the foreign function interface. In order to keep the length of this PEP reasonable, we focus on the "core" of -the foreign function interface. The following areas are left to future PEPs: - -1. asyncio -2. a JavaScript interface for managing the Python runtime +the foreign function interface. The JavaScript interface for managing the Python +runtime is left to a future PEP. Rationale @@ -1545,6 +1546,28 @@ run on. How to Teach This ================= +Pyodide has maintained a user guide for this foreign function interface for +several years, and the existing `Pyodide type translation documentation +`__ can be adapted to +form the basis of the CPython documentation. + +We have substantial experience in teaching users how to use Pyodide and for the +most part they find it very intuitive. The main area that trips up users is +memory management of ``PyProxy`` objects. For this reason, we have taken special +care to design the memory management error messages to be actionable. + + +Change History +============== + +- 30-Sept-2026 + + - Reduced the amount of detail in the specification section. + - Added support for proxying and conversion of buffers. + - Added asyncio support, including an event loop, conversion between Python + and JavaScript awaitables, and deferred destruction for arguments to an + asynchronous JavaScript function called from Python. + Reference Implementation ======================== @@ -1555,7 +1578,7 @@ Pyodide, https://github.com/hoodmane/cpython/tree/js-ffi Acknowledgments =============== -Mike Droettboom, Roman Yurchak, Gyeongjae Choi, Andrea Giammarchi +Mike Droettboom, Roman Yurchak, Gyeongjae Choi, Andrea Giammarchi, and Thorsten Beier. Copyright =========