-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add docstring #11
Comments
We need to find a format asap. |
De ton link "Note that the reST is recommended by the PEP 287 Donc worst case on fallback sur cella, mais j'aime bien cella de google je On Tue, Jul 14, 2015 at 4:43 PM, ASalvail [email protected] wrote:
|
Because Python is dynamically typed, APIs can be somewhat confusing without clear docstrings. Personally, I found Numpydoc much clearer since it provides information about what a given function expects in inputs (it is also usable by Sphinx as the others). That being said, we should use a format that is supported by readthedocs.org. An online documentation is infinitely better than the best offline format. |
I don't see the advantage of numpy over google. The main diff is that numpy
|
In the google format the type of the parameter will have to be specified as text in the description of the parameter anyway. The information is still there but might be less easy to see it at first glance. I also don't think space is an issue if it helps to be clearer. |
Personally, I'm used to the numpy format. Two criterion I'd look at : I want sphinx to work with it (giving us the online doc), but especially, I want the docstrings to be mostly generated automatically. Otherwise, we'll simple put off writing doc until it's too late. |
Nevermind : https://github.com/dadadel/pyment generates numpydocs. That'd be my first choice. |
"Pyment will generate docstrings where it doesn't exist. It will complete where it is partial. Or it will simply convert where the format is not the wanted one." So, basically we can write the docstring in the format we want and pyment will convert it to reST. :D |
Interesting thing to add : Unless decided otherwise, I'll add these type hints to functions (if only for docstring autogen). |
@ASalvail have you check that it does help pyment generate docstring including parameters type? Do you know, if it is compatible with numpy style docstring? Obviously pep-0484 only shows examples using reST (PEP 287). |
Also, is it supported by python 3.3 or only python 3.5? |
The annotations, yes. The specific annotations that'll become standard in 3.5, no. You can still put them in, it won't make any error, but it'll be supported for use by introspection tools. |
It does help in pycharm; I don't know about the doc generator. |
Make sure we provide useful docstring.
The text was updated successfully, but these errors were encountered: