Fix override func style and regular usage (#7050)

* style: add space and rm redundant parentheses

* refactor: use super to replace inherit class

* Prefer explicit tuple syntax
This commit is contained in:
Chris Guo 2019-11-18 20:30:36 +08:00 committed by Tom Christie
parent 323e1cddda
commit cad1b08260

View File

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