Skip to content

Commit 32b51e3

Browse files
authored
gh-162196: Clarify Android API level documentation (#162506)
Android recently started allowing non-integer API levels; clarify that APIs returning Android API level return the major API level only.
1 parent 187da85 commit 32b51e3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎Doc/library/platform.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ Android platform
325325

326326
* ``release`` - Android version, as a string (e.g. ``"14"``).
327327

328-
* ``api_level`` - API level of the running device, as an integer (e.g. ``34``
328+
* ``api_level`` - Major component of the API level, as an integer (e.g. ``34``
329329
for Android 14). To get the API level which Python was built against, see
330330
:func:`sys.getandroidapilevel`.
331331

‎Doc/library/sys.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
862862

863863
.. function:: getandroidapilevel()
864864

865-
Return the build-time API level of Android as an integer. This represents the
866-
minimum version of Android this build of Python can run on. For runtime
867-
version information, see :func:`platform.android_ver`.
865+
Return the major component of the Android API level that Python was built
866+
against, as an integer. For runtime version information, see
867+
:func:`platform.android_ver`.
868868

869869
.. availability:: Android.
870870

0 commit comments

Comments
 (0)