summaryrefslogtreecommitdiff
path: root/django/utils/datastructures.py
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2021-03-10 08:29:05 +0000
committerGitHub <noreply@github.com>2021-03-10 09:29:05 +0100
commitafb0eb8bb3e1c6f7ea842d2cede684eb4aec3f3d (patch)
tree0e065894493ede52a2db66e0d998301bd3079445 /django/utils/datastructures.py
parentba9a2b754452b542d3f472f0acce6f940911aced (diff)
Refs #24121 -- Added __repr__() to OrderedSet.
Diffstat (limited to 'django/utils/datastructures.py')
-rw-r--r--django/utils/datastructures.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py
index 99f9ff2a72..e605ce0720 100644
--- a/django/utils/datastructures.py
+++ b/django/utils/datastructures.py
@@ -37,6 +37,10 @@ class OrderedSet:
def __len__(self):
return len(self.dict)
+ def __repr__(self):
+ data = repr(list(self.dict)) if self.dict else ''
+ return f'{self.__class__.__qualname__}({data})'
+
class MultiValueDictKeyError(KeyError):
pass