Incorrect type in docstring
See original GitHub issueSphinx do not use typing
, but a more classical system, with built-in types separted with or
Example, this is incorrect: https://github.com/Azure/azure-sdk-for-python/blob/3fdbaa75e5ef2cd9f0151a71992d50d0c7820739/sdk/servicebus/azure-servicebus/azure/servicebus/_common/message.py#L69-L82
Should be more:
:type body: str or bytes
:keyword dict[str,any] application_properties: The user defined properties on the message.
:keyword dict[str, any] session_id: The session identifier of the message for a sessionful entity.
Can can add or None
if the optionality matters, but we should clarify it in the text.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Is it possible to highlight incorrect type references in docstring ...
I'm using 2016.1. Sure, PyCharm highlights misspelled variables and classes, but only in code, not in docstrings. Unfortunately types mentioned ...
Read more >Type hints in docstrings not handled correctly in combination ...
When using type hints in Python docstrings PyCharm 2020.2 gives false warnings about using the wrong type in combination with Union from pythons...
Read more >Incorrect type in docstring of add_label method? · Issue #438 · aplpy ...
The type of the relative parameter of the add_label method in aplpy/core.py is given as str, optional in the method's docstring. However, judging...
Read more >Support for NumPy and Google style docstrings
PEP 484 introduced a standard way to express types in Python code. This is an alternative to expressing types directly in docstrings. One...
Read more >example_google — Solutions 0.0.1 documentation
[docs]def function_with_types_in_docstring(param1, param2): """Example function with types documented in the docstring. `PEP 484`_ type annotations are ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Short version: just keep it simple and use dict Long version: you can write anything you want as long as you don’t use space, and use
[]
for generics andor
But rational is docstring are NOT typing, so you don’t need to restrain yourself to typing, just try to bring clarity for doc reader
fix pylance error when
# type: ignore
is removed fromeventhub/_pyamqp/_transport.py
line 719 (except (WebSocketTimeoutException, ...) as exc: