diff options
Diffstat (limited to 'django/utils/hashable.py')
| -rw-r--r-- | django/utils/hashable.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/django/utils/hashable.py b/django/utils/hashable.py index 7d137ccc2f..042e1a4373 100644 --- a/django/utils/hashable.py +++ b/django/utils/hashable.py @@ -8,10 +8,12 @@ def make_hashable(value): The returned value should generate the same hash for equal values. """ if isinstance(value, dict): - return tuple([ - (key, make_hashable(nested_value)) - for key, nested_value in sorted(value.items()) - ]) + return tuple( + [ + (key, make_hashable(nested_value)) + for key, nested_value in sorted(value.items()) + ] + ) # Try hash to avoid converting a hashable iterable (e.g. string, frozenset) # to a tuple. try: |
