Opened 2 months ago
Closed 7 weeks ago
#36477 closed Cleanup/optimization (fixed)
Add an internal helper for deprecating positional arguments in favor of keyword-only arguments
Reported by: | Sarah Boyce | Owned by: | Mike Edmunds |
---|---|---|---|
Component: | Utilities | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Mike Edmunds, Adam Johnson | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It is a fairly common pattern that "passing positional arguments [argument names] to [something] is deprecated in favor of keyword-only arguments".
See #34355, #35060 and #36163 for some examples.
As this is common, it would be useful to have a utility to help do this correctly (see #35554 for an issue we have had with this deprecation pathway previously).
It would also be nice to have this utility documented within the deprecation section in the contributing docs: https://docs.djangoproject.com/en/5.2/internals/contributing/writing-code/submitting-patches/#deprecating-a-feature
https://github.com/django/django/pull/19145 implements a decorator to do this
Change History (5)
comment:1 by , 2 months ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 2 months ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
comment:3 by , 2 months ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
comment:4 by , 7 weeks ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:5 by , 7 weeks ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In f42b89f: