refactor: use super to replace inherit class

This commit is contained in:
Chris Guo 2019-11-12 13:59:50 +08:00 committed by Ryan P Kilby
parent c721f49c75
commit 0940d6f26f

View File

@ -47,7 +47,7 @@ class Hyperlink(str):
in some contexts, or render as a plain URL in others. in some contexts, or render as a plain URL in others.
""" """
def __new__(cls, url, obj): def __new__(cls, url, obj):
ret = str.__new__(cls, url) ret = super().__new__(cls, url)
ret.obj = obj ret.obj = obj
return ret return ret