-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
feature: Warn about attributes sections found in __init__
method docstrings
#144
Comments
Hello, thanks for the report!
class MolecularFamily:
"""Class to model molecular family.
Attributes:
family_id: Unique id for the molecular family.
spectra_ids: Set of spectrum ids in the molecular family.
"""
def __init__(self, family_id: str):
"""Initialize the molecular family.
Args:
family_id: Unique id for the molecular family.
"""
self.family_id: str = family_id
self.spectra_ids: set[str] = set()
self._spectra: set[Spectrum] = set()
self._strains: StrainCollection = StrainCollection() I'll close this but feel free to comment further! Maybe I'm missing something here. |
Actually I'll reopen, as we could maybe emit a warning when we find an attributes section in an |
__init__
method__init__
method docstrings
Thanks for the explanation! It's nice to emit a warning. |
Description of the bug
If attributes are documented in the
__init__
method (see class below), their types are missing after rendering (see the screenshot).screenshot
To Reproduce
Full traceback
Full traceback
Expected behavior
Not matter where attributes are documented (module level, class level or
__init__
method), their types should be extracted and rendered properly.Environment information
python -m mkdocstrings_handlers.python.debug # | xclip -selection clipboard
mkdocs
v1.5.3mkdocstrings
v0.24.1mkdocstrings-python
v1.9.0griffe
v0.42.0Additional context
mkdocs.yml
The text was updated successfully, but these errors were encountered: