Skip to content

Commit

Permalink
simplify PrettyRepr
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshix-1 committed Apr 25, 2024
1 parent e46b400 commit f91e85c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions typed_stream/_impl/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,9 @@ def __repr__(self) -> str:
args = ",".join(
[("..." if arg is ... else repr(arg)) for arg in self._get_args()]
)
return f"{self.__class__._full_class_name()}({args})"

@classmethod
def _full_class_name(cls) -> str:
"""Return the fully qualified name of the class."""
# if getattr(import_module("typed_stream"), cls.__name__, None) is cls:
# return f"typed_stream.{cls.__name__}"
return f"{cls.__module__}.{cls.__qualname__}"
return (
f"{self.__class__.__module__}.{self.__class__.__qualname__}({args})"
)

@abc.abstractmethod
def _get_args(self) -> tuple[object, ...]: # pragma: no cover
Expand Down

0 comments on commit f91e85c

Please sign in to comment.