]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/simastr.py
Fixed str inheritance (calling __new__/super)
[mpd-sima.git] / sima / lib / simastr.py
index 56cd2423a0474b540df2c4f010ee89f017585b0e..c7162144cd95cb3b3d65b793e3e18871ed16e220 100644 (file)
@@ -101,13 +101,15 @@ class SimaStr(str):
     def __init__(self, fuzzstr):
         """
         """
-        super().__init__(fuzzstr)
         self.orig = str(fuzzstr)
         self.stripped = str(fuzzstr.strip())
         # fuzzy computation
         self._get_root()
         self.remove_diacritics()
 
+    def __new__(cls, fuzzstr):
+        return super(SimaStr, cls).__new__(cls, fuzzstr)
+
     def _get_root(self):
         """
         Remove all patterns in string.