#36215: Use PEP 448 unpacking to concatenate iterables
-------------------------------------+-------------------------------------
Reporter: Aarni Koskela | Type:
| Cleanup/optimization
Status: new | Component:
| Uncategorized
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
https://peps.python.org/pep-0448/ (shipped in Python 3.5) adds support for
unpacking in tuple/list displays.
This is faster in micro-benchmarks (every little helps), more concise,
arguably more readable, and avoids certain classes of bugs where users
pass in tuples where Django expects lists and vice versa (see e.g.
https://github.com/django/django/pull/15270).
Some instances of this can be automatically found and fixed with the Ruff
linter's RUF005 rule (https://docs.astral.sh/ruff/rules/collection-
literal-concatenation/).
--
Ticket URL: <https://code.djangoproject.com/ticket/36215>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/010701953c81b477-2ec877bb-8bd9-47d5-8ce0-e27e282cc889-000000%40eu-central-1.amazonses.com.