@@ -855,6 +855,11 @@ always available. Unless explicitly noted otherwise, all variables are read-only
855855   reflect the actual number of references.  Consequently, do not rely
856856   on the returned value to be accurate, other than a value of 0 or 1.
857857
858+    .. impl-detail ::
859+ 
860+       :term: `Immortal <immortal> ` objects with a large reference count can be
861+       identified via :func: `_is_immortal `.
862+ 
858863   .. versionchanged :: 3.12 
859864      Immortal objects have very large refcounts that do not match
860865      the actual number of references to the object.
@@ -1264,6 +1269,24 @@ always available. Unless explicitly noted otherwise, all variables are read-only
12641269
12651270   .. versionadded :: 3.12 
12661271
1272+ .. function :: _is_immortal(op) 
1273+ 
1274+    Return :const: `True ` if the given object is :term: `immortal `, :const: `False `
1275+    otherwise.
1276+ 
1277+    .. note ::
1278+ 
1279+       Objects that are immortal (and thus return ``True `` upon being passed
1280+       to this function) are not guaranteed to be immortal in future versions,
1281+       and vice versa for mortal objects.
1282+ 
1283+    .. versionadded :: next 
1284+ 
1285+    .. impl-detail ::
1286+ 
1287+       This function should be used for specialized purposes only.
1288+       It is not guaranteed to exist in all implementations of Python.
1289+ 
12671290.. function :: _is_interned(string) 
12681291
12691292   Return :const: `True ` if the given string is "interned", :const: `False `
@@ -1422,6 +1445,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
14221445   AIX              ``'aix' ``
14231446   Android          ``'android' ``
14241447   Emscripten       ``'emscripten' ``
1448+    FreeBSD          ``'freebsd' ``
14251449   iOS              ``'ios' ``
14261450   Linux            ``'linux' ``
14271451   macOS            ``'darwin' ``
@@ -1432,12 +1456,12 @@ always available. Unless explicitly noted otherwise, all variables are read-only
14321456
14331457   On Unix systems not listed in the table, the value is the lowercased OS name
14341458   as returned by ``uname -s ``, with the first part of the version as returned by
1435-    ``uname -r `` appended, e.g. ``'sunos5' `` or `` 'freebsd8' `` , *at the time 
1436-    when Python was built  *.   Unless you want to test for a specific system
1437-    version, it is therefore  recommended to use the following idiom::
1459+    ``uname -r `` appended, e.g. ``'sunos5' ``, *at the time when Python was built  *. 
1460+    Unless you want to test for a specific system version, it is therefore 
1461+    recommended to use the following idiom::
14381462
1439-       if sys.platform.startswith('freebsd '): 
1440-           # FreeBSD -specific code here... 
1463+       if sys.platform.startswith('sunos '): 
1464+           # SunOS -specific code here... 
14411465
14421466   .. versionchanged :: 3.3 
14431467      On Linux, :data: `sys.platform ` doesn't contain the major version anymore.
@@ -1451,6 +1475,10 @@ always available. Unless explicitly noted otherwise, all variables are read-only
14511475      On Android, :data: `sys.platform ` now returns ``'android' `` rather than
14521476      ``'linux' ``.
14531477
1478+    .. versionchanged :: 3.14 
1479+       On FreeBSD, :data: `sys.platform ` doesn't contain the major version anymore.
1480+       It is always ``'freebsd' ``, instead of ``'freebsd13' `` or ``'freebsd14' ``.
1481+ 
14541482   .. seealso ::
14551483
14561484      :data: `os.name ` has a coarser granularity.  :func: `os.uname ` gives
0 commit comments