mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
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:
parent
323e1cddda
commit
cad1b08260
|
@ -47,12 +47,12 @@ 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
|
||||||
|
|
||||||
def __getnewargs__(self):
|
def __getnewargs__(self):
|
||||||
return(str(self), self.name,)
|
return (str(self), self.name)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user