Skip to content

Commit cad1b08

Browse files
chrisguoxtomchristie
authored andcommitted
Fix override func style and regular usage (encode#7050)
* style: add space and rm redundant parentheses * refactor: use super to replace inherit class * Prefer explicit tuple syntax
1 parent 323e1cd commit cad1b08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rest_framework/relations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ class Hyperlink(str):
4747
in some contexts, or render as a plain URL in others.
4848
"""
4949
def __new__(cls, url, obj):
50-
ret = str.__new__(cls, url)
50+
ret = super().__new__(cls, url)
5151
ret.obj = obj
5252
return ret
5353

5454
def __getnewargs__(self):
55-
return(str(self), self.name,)
55+
return (str(self), self.name)
5656

5757
@property
5858
def name(self):

0 commit comments

Comments
 (0)