Skip to content

Conversation

wking
Copy link
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
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