chiark / gitweb /
documentation/python: the plain type name wasn't correctly name-mapped.
authorVladimír Vondruš <mosra@centrum.cz>
Fri, 27 Sep 2024 13:41:07 +0000 (15:41 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 28 Sep 2024 01:44:29 +0000 (03:44 +0200)
Fortunately the template uses the type_link property, so this bug wasn't
really visible anywhere.

documentation/python.py

index 2e3988ced4ad39107c32eb36a476f3be036867f5..2bb70124c3dbbd42dd8c5b157c539c1c1f40a971 100755 (executable)
@@ -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)