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

Use pprint to show Docstring objects #8

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# (Fork) 0.0.9 (2024-06-26)

- Switched to pprint to show details of a `Docstring` object

# (Fork) 0.0.8 (2024-06-23)

- Added support for parsing attributes from Sphinx-style docstrings
Expand Down
3 changes: 2 additions & 1 deletion docstring_parser/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Common methods for parsing."""
import enum
import pprint
import typing as T

ATTR_KEYWORDS = {
Expand Down Expand Up @@ -206,7 +207,7 @@ def __init__(
self.style = style # type: T.Optional[DocstringStyle]

def __repr__(self) -> str:
return str(self.__dict__)
return pprint.pformat(self.__dict__, indent=2)

@property
def description(self) -> T.Optional[str]:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "docstring_parser_fork"
version = "0.0.8"
version = "0.0.9"
description = "Parse Python docstrings in reST, Google and Numpydoc format"
authors = ["Marcin Kurczewski <[email protected]>"]
license = "MIT"
Expand Down
Loading