Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a note to the docs and fix tests.
  • Loading branch information
ZeroIntensity committed Jan 5, 2025
commit b545f24c58ffd171843002799e29ade3cd30b578
5 changes: 5 additions & 0 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,11 @@ always available.
Return :const:`True` if the given object is :term:`immortal`, :const:`False`
otherwise.

.. note::

Objects that are immortal (and thus return ``True`` upon being passed to this function)
are not guaranteed to be immortal in future versions, and vice versa for mortal objects.
Comment thread
ZeroIntensity marked this conversation as resolved.
Outdated

.. versionadded:: next

.. impl-detail::
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def test_43581(self):
# the test runs under regrtest.
self.assertEqual(sys.__stdout__.encoding, sys.__stderr__.encoding)

@unittest.skipUnless(hasattr(sys, "_is_immortal"))
@unittest.skipUnless(hasattr(sys, "_is_immortal"), "immortality is not supported")
def test_immortal(self):
# Not extensive
known_immortals = (True, False, None, 0, ())
Expand Down