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 useful docstrings #44
Comments
Fyi - I am slowly adding doc strings to guizero, I do them as an when I make a significant change to a class. |
Hello guys! if you want I can add the doc strings class by class making a PR. One important thing IMHO is to decide what type of doc string to use, here I have looked for the most used ones:
Also as far as I know Sphinx's (as @tjguk commented) can be used to auto generate reStructuredText Doc Strings. I would also recommend to set this code style on the Contributing section of the Wiki Regards. |
@yeyeto2788 I have already started to add doc strings into the guizero class using reStructuredText. See ListBox for an example https://github.com/lawsie/guizero/blob/master/guizero/ListBox.py Any help in adding additional doc strings would be greatly received. :) |
Are you running a docstring branch / PR or just docstring-ing as you go along? |
As I go. If I change a class I tend to take the opportunity to document it. |
Makes sense. I hope to start using guizero for some sessions I'm running with a few Y8s. If I do I'll try to get them to contribute docstrings as part of the learning experience |
Hello guys! Sorry for the late reply. @martinohanlon I will then use reStructuredText @tjguk I will start from tomorrow and I thought about making a branch for docstring and after reviewing the PR can be merge to master. Let me know if this approach is ok for you guys. Regards |
For my part, go ahead with whatever works. Insofar as I end up contributing, I'll follow along with whatever's acceptable |
Closing - the vast majority of doc strings are included, those that arent can be added as and when needed. |
(Not unrelated to #38)
At present if you help() the package itself or any of its components, you basically get the whole Tk stack and no overview. In general, in Python, encourage exploration via introspection (help, dir, inspect etc.). And tools like IPython and the built-in docs browser support that to a considerable extent.
Here's an example from my own networkzero:
Help on module networkzero.discovery in networkzero:NAME
networkzero.discovery - Advertise and collect advertisements of network services
DESCRIPTION
The discovery module offers:
FUNCTIONS
advertise(name, address=None, fail_if_exists=False, ttl_s=20)
Advertise a name at an address
In this case I'm using Sphinx's auto-doc features to combine this help() text with some other narrative in the documentation, but I see it as very key that people be able to help(mymodule) and get more than the barebones alpha-orderd breakdown of what's in it.
The text was updated successfully, but these errors were encountered: