scriptharness / python-scriptharness

http://python-scriptharness.readthedocs.org/
Mozilla Public License 2.0
2 stars 2 forks source link

Conform to PEP 484 for type hints in docstrings #7

Closed carocad closed 9 years ago

carocad commented 9 years ago

Hey Aki, Since you aim to keep scriptharnes with full documentation, I think it would be worth noticing that the latest docstring convention changed. For example:

    # instead of writing 
    path (str, optional)
    # now it should be 
    path (Optional(str))

You can check the latest docstrings examples at: http://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_google.html and the complete PEP at https://www.python.org/dev/peps/pep-0484/

escapewindow commented 9 years ago

Cool, thanks! https://github.com/escapewindow/python-scriptharness/commit/2333246ee499e389f67753c60ac2cbff0dc8771c

carocad commented 9 years ago

Hey Aki, That was fast, cool =D. Just a tip: Almost all of the other type hints also changed :/ Such as:

    List[str]
    Any # for accepting any type of object
    Callabe[str, int] # for passing functions and similars

and many others. I dont know if you would like to change all of them but I thought it would be nice to let you know ;) You can see most of the fundamental type hint convention at: https://www.python.org/dev/peps/pep-0484/#the-typing-module

escapewindow commented 9 years ago

@carocad , is that something you want to work on? Otherwise I'll leave this open until I have time to update all the docstrings.

carocad commented 9 years ago

Hey @escapewindow, I am still working on the mozharness docstring, and I dont have so much time available at the moment. I will probably have some time by the end of nex week, so if by that time you havent updated them, I will work on them ;)