diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ed649e..29b18aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,17 @@ First official documentation. _______________________________________________________________________________ +## [0.1.2] - 2021-12-01 + +This release adds support for arbitrary types; previously `AnsiEscape` only supported strings. + +### Changed + +- Changed `AnsiEscape` to support any type +- Updated the localisation files + +_______________________________________________________________________________ + ## [0.1.1] - 2021-12-01 A hotfix release that fixes a problem in the README example code, and adds a screenshot of the code running. diff --git a/escapyde/ansi.py b/escapyde/ansi.py index 02af5df..03c1f38 100644 --- a/escapyde/ansi.py +++ b/escapyde/ansi.py @@ -21,15 +21,12 @@ def __str__(self) -> str: return '' def __or__(self, other): - if isinstance(other, str): - self.string = other - return self - if isinstance(other, AnsiEscape): self.sequence += other.sequence return self - raise TypeError(f"Not compatible with type '{other.__class__.__name__}'") + self.string = str(other) + return self def __ror__(self, other): return self.__or__(other) diff --git a/pyproject.toml b/pyproject.toml index d9be7ba..0eedd01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ __init__.py:F401,F403,F405\ [tool.poetry] name = 'escapyde' -version = '0.1.1' +version = '0.1.2' description = "Yet another ANSI escape sequence library for Python - now modernised!" authors = ["Lari Liuhamo ",]