Skip to content

Commit a72c670

Browse files
committed
PEP 818: Add How to Teach and Change History, minor edits, new discuss post
1 parent bfec85f commit a72c670

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

‎peps/pep-0818.rst‎

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ PEP: 818
22
Title: Adding the Core of the Pyodide Foreign Function Interface to Python
33
Author: Hood Chatham <roberthoodchatham at gmail.com>
44
Sponsor: Ł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
66
Status: Draft
77
Type: Standards Track
88
Created: 10-Dec-2025
99
Python-Version: 3.16
10+
Post-History: `05-Jan-2026 <https://discuss.python.org/t/pep-818-upstreaming-the-pyodide-ffi/105530>`__
1011

1112
Abstract
1213
========
@@ -62,10 +63,8 @@ supporting ``urllib3``, ``aiohttp``, and ``httpx`` requires the foreign function
6263
interface.
6364

6465
In 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

7170
Rationale
@@ -1545,6 +1544,28 @@ run on.
15451544
How 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

15491570
Reference Implementation
15501571
========================
@@ -1555,7 +1576,7 @@ Pyodide, https://github.com/hoodmane/cpython/tree/js-ffi
15551576
Acknowledgments
15561577
===============
15571578

1558-
Mike Droettboom, Roman Yurchak, Gyeongjae Choi, Andrea Giammarchi
1579+
Mike Droettboom, Roman Yurchak, Gyeongjae Choi, Andrea Giammarchi, Thorsten Beier
15591580

15601581
Copyright
15611582
=========

0 commit comments

Comments
 (0)