Skip to content

index: Add missing 'tree' entry to diff_to_tree docstring argspec#439

Merged
jdavid merged 1 commit intolibgit2:masterfrom
wking:diff-to-tree-doc
Oct 27, 2014
Merged

index: Add missing 'tree' entry to diff_to_tree docstring argspec#439
jdavid merged 1 commit intolibgit2:masterfrom
wking:diff-to-tree-doc

Conversation

@wking
Copy link
Copy Markdown
Contributor

@wking wking commented Oct 26, 2014

It's been missing since the original argspec was added with 5ed9eb4
(Add documentation for conflicts and fixup Index, 2014-07-10).

Maybe it's better to auto-generate these for the docs? For example:

>>> import inspect
>>> import pygit2
>>> argspec = inspect.getargspec(pygit2.index.Index.diff_to_tree)
>>> inspect.formatargspec(args=argspec.args[1:], varargs=argspec.varargs,
...     varkw=argspec.keywords, defaults=argspec.defaults)
'(tree, flags=0, context_lines=3, interhunk_lines=0)'

Where the [1:] is just to drop the self entry. I imagine there's
way to get Sphinx's automethod to do this sort of thing automatically,
but I don't know what that way is.

It's been missing since the original argspec was added with 5ed9eb4
(Add documentation for conflicts and fixup Index, 2014-07-10).
@jdavid jdavid merged commit 149bb1e into libgit2:master Oct 27, 2014
@jdavid
Copy link
Copy Markdown
Member

jdavid commented Oct 27, 2014

Would be cool, but it needs to work with both sphinx and pydoc, not obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants