Skip to content
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

Support annotations defined in docstrings #839

Closed
JukkaL opened this issue Aug 20, 2015 · 3 comments
Closed

Support annotations defined in docstrings #839

JukkaL opened this issue Aug 20, 2015 · 3 comments
Labels

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Aug 20, 2015

In addition to Python 3 function annotations and type comments we should also support annotations in docstrings, following Google docstring conventions. Example:

def f(x):
    """description...

    Args:
        x (int): describe...

    Returns:
        List[str]: describe...
    """
    ...

f('x')   # Error

This would be primarily useful for code that needs to be Python 2 compatible. It should be possible to mix and match different kinds of annotations in a file. A type comment should take precedence over a docstring.

This should probably be opt-in (per file) so that we wouldn't give false positives for docstrings that don't fully conform to the expected syntax.

@presidento
Copy link

There was a similiar issue for this before: #612

@JukkaL
Copy link
Collaborator Author

JukkaL commented Aug 28, 2015

This partially addresses #612, but I'll leave #612 still open since we may wish to support additional conventions.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Jun 3, 2016

As discussed in #612, I suppose we aren't going to implement this and we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants