Skip to content

Commit

Permalink
Use pprint to show Docstring objects (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsh9 authored Jun 26, 2024
1 parent af6c3bb commit 80489b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
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

0 comments on commit 80489b0

Please sign in to comment.