-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
[Python, Beginner] Add __all__
attributes to modules.
#638
Comments
__all__
attribute to modules.__all__
attributes to modules.
@niccokunzmann Can I work on this issue? |
@mohdyawars Yes please! Let us know if you need any help with it. You can create a pull request as soon as you have a change :) Thanks! |
I am re-opening the issue because the description is not fully clear. I would like all modules in the |
Hi, I'd like to help a friend solve this issue. How are we to know which functions/classes/constants are intended to be shared as a public API? From their names, where no leading underscore means public? From the docs? |
@devdanzin Thanks for asking! This file here provides a good overview over what we want to share: Some functions that look internal or constants/variables that are just used inside - if you find them - you can ask or make a judgement. Example of what is mostly used internally: icalendar/src/icalendar/cal.py Line 62 in 470485b
I am not totally clear on this at the moment but any help in creating a conversation around this and bringing clarity is much appreciated. It could also be that we might have forgotten the one or the other variable. |
If an object has a leading underscore in its name, then it is private. If it does not have a leading underscore, then it is probably public but possibly private. It's a matter of understanding its context. Documentation and docstrings should not be used as absolute truth to make a decision, but it may help you make a better informed decision. Ultimately the code's functionality is the source of truth. For how to document public members, I'd suggest the following. We currently follow default conventions of Sphinx's
There may be public members without docstrings. Sphinx will respect If a variable is public, use |
The
__all__
variable is used to show which attributes of a module are public.Please list all of the attributes that are imported in
icalendar/__init__.py
in their modules with the__all__ = []
module variable.See also:
icalendar/__init__.py
__all__
mean in Python?The text was updated successfully, but these errors were encountered: