Skip to content

Automatic arguments to Python def docstrings #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jferguson-gnubio
Copy link
Contributor

Automatically generates docstrings skeleton for python method arguments. e.g.

def foo(bar, baz=False):
    """
    Keyword Arguments:
    bar --
    baz -- (default False)
    """

In response to typing: def<tab>foo<tab>bar, baz=False<tab>

I'm submitting this for review anticipating changes, because:

  1. I have identical lisp in these two snippets. Is there a way in the context of this repo to avoid this duplication?
  2. There are other python snippets which could benefit from this too (init is an obvious one). If there's a way to resolve latex: fix the capitalization of gls on case-insensitive file systems #1 I'd like to do that before hitting those
  3. While this is the format example in PEP-257, it's not mandatory. Could consider other formats, like ":param foo" etc..?

Thoughts?

@AndreaCrotti
Copy link
Owner

Ah sorry there were actually two snippets to define a function, I removed the "def" now to avoid confusion..

New templates for function, method and __init__ with automatic
insertion of argument docstrings, keys: fd, md, id.
@jferguson-gnubio
Copy link
Contributor Author

Ok, revised submission here - 3 new snippets for function, method, init, and the lisp code extracted.

AndreaCrotti added a commit that referenced this pull request Dec 7, 2013
Automatic arguments to Python def docstrings
@AndreaCrotti AndreaCrotti merged commit fb53fbc into AndreaCrotti:master Dec 7, 2013
@AndreaCrotti
Copy link
Owner

great thanks

@jferguson-gnubio jferguson-gnubio deleted the python_arg_docstring branch December 9, 2013 13:36
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