From 1fc46e66bcd30b5af75e62d628de2fc5dcf36a79 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Sun, 31 Dec 2023 15:58:05 +0000 Subject: [PATCH] Support __add__ and __radd_ on JankStringyBytes --- hippolyzer/lib/base/datatypes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hippolyzer/lib/base/datatypes.py b/hippolyzer/lib/base/datatypes.py index f3f53aa..cb56110 100644 --- a/hippolyzer/lib/base/datatypes.py +++ b/hippolyzer/lib/base/datatypes.py @@ -317,6 +317,16 @@ class JankStringyBytes(bytes): return item in str(self) return item in bytes(self) + def __add__(self, other): + if isinstance(other, bytes): + return bytes(self) + other + return str(self) + other + + def __radd__(self, other): + if isinstance(other, bytes): + return other + bytes(self) + return other + str(self) + def lower(self): return str(self).lower()