fix(TextHandler): auto handling non-string type variables

Fix for #45
This commit is contained in:
Karim shoair
2025-03-08 01:42:58 +02:00
parent 6906b13500
commit bf6a3a9c20
+1 -3
View File
@@ -19,9 +19,7 @@ class TextHandler(str):
__slots__ = ()
def __new__(cls, string):
if isinstance(string, str):
return super().__new__(cls, string)
return super().__new__(cls, '')
return super().__new__(cls, str(string))
def __getitem__(self, key: Union[SupportsIndex, slice]) -> "TextHandler":
lst = super().__getitem__(key)