From cad1b082602ce1367cae6a3a3668a64436fb4bde Mon Sep 17 00:00:00 2001 From: Chris Guo <41265033+chrisguox@users.noreply.github.com> Date: Mon, 18 Nov 2019 20:30:36 +0800 Subject: [PATCH] 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 --- rest_framework/relations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/relations.py b/rest_framework/relations.py index 338776884..9bde79b19 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -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):