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

Docstring overhaul #77

Open
abelcheung opened this issue Dec 14, 2024 · 0 comments
Open

Docstring overhaul #77

abelcheung opened this issue Dec 14, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@abelcheung
Copy link
Owner

abelcheung commented Dec 14, 2024

Visual Studio Code has support for per-@overload Python docstring a while ago. This feature can serve as special notes for some specific @overload purpose, e.g. function argument usage that can cause problems, like #64.

We can disregard Pycharm, the next most used Python IDE, as far as types-lxml is concerned. As its strict 'everything prefixed with underscore is private' stance directly slaps face on lxml's widespread underscore usage, it becomes a crippled editor for any lxml related projects, such as not showing any superclass method in autocompletion popup for elements.

For all methods, properties and classes not documented in types-lxml, vscode can pick up __doc__ attribute from lxml runtime and display it instead. However, we need not duplicate original lxml docstrings (size is multipled by number of overloads); it is much simpler to point users to API doc on web instead.

Our docstring preferably follows numpy format, which allows more verbose description:

"""One line description of its purpose

Annotation
----------
Notes about specific `@overload`, or provide annotation-only usage for objects.
If no special explanation is necessary, it is possible to omit this section.
Link to wiki whenever necessary.

See Also
--------
[API Documentation](https://lxml.de/apidoc/......)
"""
@abelcheung abelcheung converted this from a draft issue Dec 14, 2024
@abelcheung abelcheung added the documentation Improvements or additions to documentation label Dec 14, 2024
abelcheung added a commit that referenced this issue Dec 15, 2024
Mostly adhere to format specified in #77, and a few simplistic ones removed (so that vscode picks upstream docstring from lxml runtime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Backlog
Development

No branches or pull requests

1 participant