summaryrefslogtreecommitdiff
path: root/django/utils/datastructures.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #34233 -- Used str.removeprefix()/removesuffix().Mariusz Felisiak2023-01-181-2/+1
|
* Fixed #33532 -- Optimized CaseInsensitiveMapping instantiation for dicts.Keryn Knight2022-02-231-1/+4
| | | | | | | | Internal usages of this class (e.g. HttpHeaders) provide it with a dict, so testing for that type first avoids the cost of going through the potential __instancecheck__ + _abc_instancecheck to establish it's a Mapping. Co-authored-by: Nick Pope <nick@nickpope.me.uk>
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-18/+16
|
* Optimized handling case-insensitive mappings.Illia Volochii2021-09-221-15/+18
| | | | | | | | | Elements yielded by _destruct_iterable_mapping_values are always unpacked. Since unpacking can be done with any iterable, there is no need to convert elements to tuples. Also, such elements can be used directly in for loops, creating a dictionary of them is excessive. Co-authored-by: Nick Pope <nick@nickpope.me.uk>
* Fixed 32956 -- Lowercased spelling of "web" and "web framework" where ↵David Smith2021-07-291-1/+1
| | | | appropriate.
* Refs #24121 -- Added __repr__() to OrderedSet.Nick Pope2021-03-101-0/+4
|
* Fixed #32517 -- Made OrderedSet reversible.Diego Lima2021-03-081-0/+3
| | | | Refs #32516.
* Updated MultiValueDict.update() to mirror dict.update() behavior.Nick Pope2020-10-301-8/+7
| | | | | | | | | | | | Changes in behavior include: - Accepting iteration over empty sequences, updating nothing. - Accepting iterable of 2-tuples providing key-value pairs. - Failing with the same or comparable exceptions for invalid input. Notably this replaces the previous attempt to catch TypeError which was unreachable as the call to .items() resulted in AttributeError on non-dict objects.
* Removed unused custom exception support for ImmutableList.Nick Pope2020-10-301-5/+2
| | | | | | If the warning provided was an instance of Exception, then it would be used as-is. In practice this is untested, unused and ImmutableList is an undocumented internal datastructure.
* Fixed #30159 -- Removed unneeded use of OrderedDict.Nick Pope2019-02-061-3/+1
| | | | Dicts preserve order since Python 3.6.
* Fixed #20147 -- Added HttpRequest.headers.Santiago Basulto2019-01-161-0/+59
|
* Fixed typo in django/utils/datastructures.py.Taoufik2018-10-141-1/+1
|
* Refs #28909 -- Simplifed code using unpacking generalizations.Mariusz Felisiak2018-02-261-3/+1
|
* Fixed #28996 -- Simplified some boolean constructs and removed trivial ↵Дилян Палаузов2018-01-121-4/+2
| | | | continue statements.
* Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham2017-09-071-2/+3
| | | | This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
* Used OrderedDict.fromkeys() to initialize OrderedDict with None values.Sergey Fedoseev2017-08-231-1/+1
|
* Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen2017-06-281-3/+2
|
* Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne2017-05-271-1/+1
| | | iter(dict) is equivalent to iter(dict.keys()).
* Fixed #28064 -- Removed double-quoting of key names in MultiValueDictKeyError.petedmarsh2017-04-111-1/+1
|
* Made MultiValueDict.__deepcopy__()'s memo kwarg an arg.Daniel F Moisset2017-04-071-3/+1
| | | It's always provided.
* Refs #27656 -- Updated django.utils docstring verbs according to PEP 257.Anton Samarchyan2017-02-111-17/+12
|
* Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments.Vytis Banaitis2017-02-011-6/+1
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-10/+9
|
* Refs #23919 -- Removed __nonzero__() methods (for Python 2).Simon Charette2017-01-191-3/+0
| | | | Thanks Tim for the review.
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-1/+1
|
* Refs #23919 -- Removed most of remaining six usageClaude Paroz2017-01-181-4/+2
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz2017-01-181-21/+3
| | | | Thanks Tim Graham for the review.
* Fixed #27583 -- Fixed MultiValueDict.getlist() crash when values for key is ↵Mariusz Felisiak2016-12-091-1/+1
| | | | | None. Restored the behavior before 727d7ce6cba21363470aaefb2dc5353017531be3.
* Fixed #27198 -- Made MultiValueDict.getlist() return a new list to prevent ↵Jani Tiainen2016-09-161-6/+19
| | | | mutation.
* Fixed #25093 -- Added utils.datastructures.OrderedSet.__len__()darkryder2015-07-091-0/+3
|
* Removed django.utils.datastructures.SortedDict per deprecation timeline.Tim Graham2015-01-171-125/+0
|
* Removed django.utils.datastructures.MergeDict per deprecation timeline; refs ↵Tim Graham2015-01-171-115/+0
| | | | #18659.
* Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne2014-12-081-2/+2
| | | | comprehension
* Fixed #23664 -- Provided a consistent definition for OrderedSet.__bool__Thomas Chaumeny2014-10-161-1/+4
| | | | This also defines QuerySet.__bool__ for consistency though this should not have any consequence as bool(qs) used to fallback on QuerySet.__len__ in Py3.
* Revert "Fixed #23384 -- Allowed overriding part of a dictionary-type setting"Claude Paroz2014-09-051-20/+0
| | | | | | | This reverts commit 66757fee7e921ad4c35e0b3f80c25e026100b31c. Discussions have led to think that this functionality does not bring significant benefits to justify the added complexity. Read also discussions on ticket #22734.
* Fixed #23384 -- Allowed overriding part of a dictionary-type settingClaude Paroz2014-08-301-0/+20
| | | | | | This change is needed for upcoming changes where settings might be grouped in a parent dictionary. Thanks Tim Graham for the review.
* Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warningsClaude Paroz2014-03-081-2/+4
| | | | | Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
* Correct flake8 E302 violationsRay Ashman Jr2013-11-021-0/+6
|
* Fixed E225 pep8 warnings.Tim Graham2013-10-231-1/+1
|
* Fixed E221 pep8 warnings.Tim Graham2013-10-221-11/+11
|
* Fixed #18659 -- Deprecated request.REQUEST and MergeDictBouke Haarsma2013-10-171-0/+2
| | | | Thanks Aymeric Augustin for the suggestion.
* Fixed #15625 -- Made message in MultiValueDictKeyError less verbose.Tim Graham2013-09-181-1/+1
| | | | Thanks margieroginski for the suggestion.
* Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette2013-08-301-1/+1
|
* Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()Tim Graham2013-08-291-1/+1
| | | | | Thanks jeroen.pulles at redslider.net for the suggestion and helper script.
* Docs tweaks (thanks timgraham)Andrew Godwin2013-08-101-1/+1
|
* Back SortedSet onto OrderedDict, rename it, and a few typo fixesAndrew Godwin2013-08-101-2/+3
|
* Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin2013-08-091-1/+5
|\ | | | | | | | | | | | | | | | | | | Conflicts: django/core/management/commands/flush.py django/core/management/commands/syncdb.py django/db/models/loading.py docs/internals/deprecation.txt docs/ref/django-admin.txt docs/releases/1.7.txt
| * Deprecated SortedDict (replaced with collections.OrderedDict)Curtis Maloney2013-08-041-1/+5
| | | | | | | | Thanks Loic Bistuer for the review.
* | Merge branch 'master' into schema-alterationAndrew Godwin2013-07-021-26/+0
|\ \ | |/
| * Removed insert(), value_for_insert() SortedDict methods deprecated in Django ↵Ramiro Morales2013-06-281-26/+0
| | | | | | | | 1.5.