Skip to content

Commit de729fc

Browse files
freakboy3742hugovkJacobCoffeemhsmithned-deily
authored andcommitted
pythongh-114099: Add documentation for iOS platform (pythonGH-117057)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Jacob Coffee <jacob@z7x.org> Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Ned Deily <nad@python.org>
1 parent 06b3628 commit de729fc

25 files changed

+584
-161
lines changed

Doc/includes/wasm-ios-notavail.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. include for modules that don't work on WASM or iOS
2+
3+
.. availability:: not WASI, not iOS.
4+
5+
This module does not work or is not available on WebAssembly platforms, or
6+
on iOS. See :ref:`wasm-availability` for more information on WASM
7+
availability; see :ref:`iOS-availability` for more information on iOS
8+
availability.

Doc/includes/wasm-notavail.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.. include for modules that don't work on WASM
22
3-
.. availability:: not Emscripten, not WASI.
3+
.. availability:: not WASI.
44

5-
This module does not work or is not available on WebAssembly platforms
6-
``wasm32-emscripten`` and ``wasm32-wasi``. See
5+
This module does not work or is not available on WebAssembly. See
76
:ref:`wasm-availability` for more information.

Doc/library/curses.rst

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ for Windows, DOS, and possibly other systems as well. This extension module is
2121
designed to match the API of ncurses, an open-source curses library hosted on
2222
Linux and the BSD variants of Unix.
2323

24+
.. include:: ../includes/wasm-ios-notavail.rst
25+
2426
.. note::
2527

2628
Whenever the documentation mentions a *character* it can be specified

Doc/library/dbm.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ slow-but-simple implementation in module :mod:`dbm.dumb` will be used. There
1919
is a `third party interface <https://www.jcea.es/programacion/pybsddb.htm>`_ to
2020
the Oracle Berkeley DB.
2121

22+
.. include:: ../includes/wasm-ios-notavail.rst
2223

2324
.. exception:: error
2425

@@ -455,4 +456,3 @@ The :mod:`!dbm.dumb` module defines the following:
455456
.. method:: dumbdbm.close()
456457

457458
Close the database.
458-

Doc/library/ensurepip.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ when creating a virtual environment) or after explicitly uninstalling
3838
:pep:`453`: Explicit bootstrapping of pip in Python installations
3939
The original rationale and specification for this module.
4040

41-
.. include:: ../includes/wasm-notavail.rst
41+
.. include:: ../includes/wasm-ios-notavail.rst
4242

4343
Command line interface
4444
----------------------

Doc/library/fcntl.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines.
1818
See the :manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages
1919
for full details.
2020

21-
.. availability:: Unix, not Emscripten, not WASI.
21+
.. availability:: Unix, not WASI.
2222

2323
All functions in this module take a file descriptor *fd* as their first
2424
argument. This can be an integer file descriptor, such as returned by

Doc/library/grp.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
This module provides access to the Unix group database. It is available on all
1111
Unix versions.
1212

13-
.. availability:: Unix, not Emscripten, not WASI.
13+
.. availability:: Unix, not WASI, not iOS.
1414

1515
Group database entries are reported as a tuple-like object, whose attributes
1616
correspond to the members of the ``group`` structure (Attribute field below, see

Doc/library/intro.rst

+42-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Notes on availability
5858
operating system.
5959

6060
* If not separately noted, all functions that claim "Availability: Unix" are
61-
supported on macOS, which builds on a Unix core.
61+
supported on macOS and iOS, both of which build on a Unix core.
6262

6363
* If an availability note contains both a minimum Kernel version and a minimum
6464
libc version, then both conditions must hold. For example a feature with note
@@ -119,3 +119,44 @@ DOM APIs as well as limited networking capabilities with JavaScript's
119119
.. _wasmtime: https://wasmtime.dev/
120120
.. _Pyodide: https://pyodide.org/
121121
.. _PyScript: https://pyscript.net/
122+
123+
.. _iOS-availability:
124+
125+
iOS
126+
---
127+
128+
iOS is, in most respects, a POSIX operating system. File I/O, socket handling,
129+
and threading all behave as they would on any POSIX operating system. However,
130+
there are several major differences between iOS and other POSIX systems.
131+
132+
* iOS can only use Python in "embedded" mode. There is no Python REPL, and no
133+
ability to execute binaries that are part of the normal Python developer
134+
experience, such as :program:`pip`. To add Python code to your iOS app, you must use
135+
the :ref:`Python embedding API <embedding>` to add a Python interpreter to an
136+
iOS app created with Xcode. See the :ref:`iOS usage guide <using-ios>` for
137+
more details.
138+
139+
* An iOS app cannot use any form of subprocessing, background processing, or
140+
inter-process communication. If an iOS app attempts to create a subprocess,
141+
the process creating the subprocess will either lock up, or crash. An iOS app
142+
has no visibility of other applications that are running, nor any ability to
143+
communicate with other running applications, outside of the iOS-specific APIs
144+
that exist for this purpose.
145+
146+
* iOS apps have limited access to modify system resources (such as the system
147+
clock). These resources will often be *readable*, but attempts to modify
148+
those resources will usually fail.
149+
150+
* iOS apps have a limited concept of console input and output. ``stdout`` and
151+
``stderr`` *exist*, and content written to ``stdout`` and ``stderr`` will be
152+
visible in logs when running in Xcode, but this content *won't* be recorded
153+
in the system log. If a user who has installed your app provides their app
154+
logs as a diagnostic aid, they will not include any detail written to
155+
``stdout`` or ``stderr``.
156+
157+
iOS apps have no concept of ``stdin`` at all. While iOS apps can have a
158+
keyboard, this is a software feature, not something that is attached to
159+
``stdin``.
160+
161+
As a result, Python library that involve console manipulation (such as
162+
:mod:`curses` and :mod:`readline`) are not available on iOS.

Doc/library/multiprocessing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
--------------
1010

11-
.. include:: ../includes/wasm-notavail.rst
11+
.. include:: ../includes/wasm-ios-notavail.rst
1212

1313
Introduction
1414
------------

0 commit comments

Comments
 (0)