chiark / gitweb /
documentation/python: minor cleanup, naming consistency.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 28 Aug 2019 19:20:04 +0000 (21:20 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Fri, 30 Aug 2019 14:47:58 +0000 (16:47 +0200)
documentation/python.py

index 0322a05dad3f9be2197126da1af6e29a740381ea..9ef15502d76b076c8f335b774417334f7dce4013 100755 (executable)
@@ -1208,7 +1208,7 @@ def extract_function_doc(state: State, parent, entry: Empty) -> List[Any]:
                         positional_only = False
                         break
 
-            arg_types = []
+            param_types = []
             signature = []
             for i, arg in enumerate(args):
                 name, type, type_link, default = arg
@@ -1217,11 +1217,11 @@ def extract_function_doc(state: State, parent, entry: Empty) -> List[Any]:
                 # Don't include redundant type for the self argument
                 if i == 0 and name == 'self':
                     param.type, param.type_link = None, None
-                    arg_types += [None]
+                    param_types += [None]
                     signature += ['self']
                 else:
                     param.type, param.type_link = type, type_link
-                    arg_types += [type]
+                    param_types += [type]
                     signature += ['{}: {}'.format(name, type)]
                 if default:
                     # If the type is a registered enum, try to make a link to
@@ -1251,7 +1251,7 @@ def extract_function_doc(state: State, parent, entry: Empty) -> List[Any]:
 
             # Format the anchor. Pybind11 functions are sometimes overloaded,
             # thus name alone is not enough.
-            out.id = state.config['ID_FORMATTER'](EntryType.OVERLOADED_FUNCTION, entry.path[-1:] + arg_types)
+            out.id = state.config['ID_FORMATTER'](EntryType.OVERLOADED_FUNCTION, entry.path[-1:] + param_types)
 
             # Get summary and details. Passing the signature as well, so
             # different overloads can (but don't need to) have different docs.
@@ -1853,6 +1853,7 @@ def render_doc(state: State, filename):
         docutils.utils.assemble_option_dict = _docutils_assemble_option_dict
 
         publish_rst(state, f.read())
+
         docutils.utils.extract_options = prev_extract_options
         docutils.utils.assemble_option_dict = prev_assemble_option_dict