diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2013-12-31 17:50:36 -0800 |
---|---|---|
committer | Simon Feltman <sfeltman@src.gnome.org> | 2013-12-31 17:56:40 -0800 |
commit | 28a178e385e32c56910f1c430b370a8872218081 (patch) | |
tree | ab59f9fc2f47a30720bde69bcf2a45adec76a1ac | |
parent | 2ef59b89311529e34366d4d7aa8f8ae9a8ea6371 (diff) | |
download | pygobject-28a178e385e32c56910f1c430b370a8872218081.tar.gz |
docs: Skip implicit array length args when building function doc strings
https://bugzilla.gnome.org/show_bug.cgi?id=697356
-rw-r--r-- | gi/docstring.py | 8 | ||||
-rw-r--r-- | tests/test_docstring.py | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gi/docstring.py b/gi/docstring.py index 2aa2629c..9b4f6404 100644 --- a/gi/docstring.py +++ b/gi/docstring.py @@ -89,8 +89,12 @@ def _generate_callable_info_function_signature(info): # Build a lists of indices prior to adding the docs because # because it is possible the index retrieved comes before in # argument being used. - ignore_indices = set([arg.get_destroy() for arg in in_args]) - user_data_indices = set([arg.get_closure() for arg in in_args]) + ignore_indices = set() + user_data_indices = set() + for arg in in_args: + ignore_indices.add(arg.get_destroy()) + ignore_indices.add(arg.get_type().get_array_length()) + user_data_indices.add(arg.get_closure()) for i, arg in enumerate(in_args): if i in ignore_indices: diff --git a/tests/test_docstring.py b/tests/test_docstring.py index 54349b8c..2f176ffc 100644 --- a/tests/test_docstring.py +++ b/tests/test_docstring.py @@ -57,3 +57,7 @@ class Test(unittest.TestCase): 'progress_callback_data=None)' self.assertEqual(Gio.File.copy.__doc__, g_file_copy_doc) + + def test_array_length_arg(self): + self.assertEqual(GIMarshallingTests.array_in.__doc__, + 'array_in(ints:list)') |