From 53d0030cba9a1f5a16a03ed73bc9fdc5a4136ac6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 13 Sep 2024 23:14:52 +0200 Subject: [PATCH] documentation/python: adapt to changes in Python 3.12 builtins docs. --- documentation/python.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/documentation/python.py b/documentation/python.py index 0b1927f7..5aa328e1 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -329,6 +329,12 @@ if sys.version_info >= (3, 11): ('__getstate__', "Helper for pickle.") }) +# Python 3.12 changes the __format__ docstring +if sys.version_info >= (3, 11): + _filtered_builtin_functions.update({ + ('__format__', "Default object formatter.\n\nReturn str(self) if format_spec is empty. Raise TypeError otherwise.") + }) + _filtered_builtin_properties = set([ # (if defined) is gone in https://github.com/python/cpython/issues/112266 # which is backported all the way to 3.11 -- 2.30.2