From: Vladimír Vondruš Date: Fri, 27 Sep 2024 13:41:07 +0000 (+0200) Subject: documentation/python: the plain type name wasn't correctly name-mapped. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=02e98fa2533bb1c5fdeede0031446bd389efe812;p=blog.git documentation/python: the plain type name wasn't correctly name-mapped. Fortunately the template uses the type_link property, so this bug wasn't really visible anywhere. --- diff --git a/documentation/python.py b/documentation/python.py index 2e3988ce..2bb70124 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -1384,9 +1384,9 @@ def extract_annotation(state: State, referrer_path: List[str], annotation) -> Tu return ('None', ) + make_name_relative_link(state, referrer_path, 'None') # Otherwise it's a plain type. Turn it into a link. - name = extract_type(annotation) + name = map_name_prefix(state, extract_type(annotation)) # TODO Python 3.8+ supports `a, *b`, switch to that once 3.7 is dropped - return (name, ) + make_name_relative_link(state, referrer_path, map_name_prefix(state, name)) + return (name, ) + make_name_relative_link(state, referrer_path, name) def extract_module_doc(state: State, entry: Empty): assert inspect.ismodule(entry.object)