From 0940d6f26f6f0bc55c3c1b71fabc50e57ab85df5 Mon Sep 17 00:00:00 2001 From: Chris Guo Date: Tue, 12 Nov 2019 13:59:50 +0800 Subject: [PATCH] refactor: use super to replace inherit class --- rest_framework/relations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/relations.py b/rest_framework/relations.py index 1757f32aa..2dc888676 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -47,7 +47,7 @@ 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