Skip to content

Commit 52b4b08

Browse files
authored
Merge pull request #3 from Diapolo10/nightly
[PATCH] Support for arbitrary types
2 parents d1d44ef + e1177fb commit 52b4b08

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ First official documentation.
6868

6969
_______________________________________________________________________________
7070

71+
## [0.1.2] - 2021-12-01
72+
73+
This release adds support for arbitrary types; previously `AnsiEscape` only supported strings.
74+
75+
### Changed
76+
77+
- Changed `AnsiEscape` to support any type
78+
- Updated the localisation files
79+
80+
_______________________________________________________________________________
81+
7182
## [0.1.1] - 2021-12-01
7283

7384
A hotfix release that fixes a problem in the README example code, and adds a screenshot of the code running.

escapyde/ansi.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ def __str__(self) -> str:
2121
return ''
2222

2323
def __or__(self, other):
24-
if isinstance(other, str):
25-
self.string = other
26-
return self
27-
2824
if isinstance(other, AnsiEscape):
2925
self.sequence += other.sequence
3026
return self
3127

32-
raise TypeError(f"Not compatible with type '{other.__class__.__name__}'")
28+
self.string = str(other)
29+
return self
3330

3431
def __ror__(self, other):
3532
return self.__or__(other)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ __init__.py:F401,F403,F405\
1717

1818
[tool.poetry]
1919
name = 'escapyde'
20-
version = '0.1.1'
20+
version = '0.1.2'
2121
description = "Yet another ANSI escape sequence library for Python - now modernised!"
2222

2323
authors = ["Lari Liuhamo <lari.liuhamo+pypi@gmail.com>",]

0 commit comments

Comments
 (0)