#33199: Deprecate passing positional arguments to Signer.
-------------------------------------+-------------------------------------
Reporter: Daniel Samuels | Owner: Nikita
| Marchant
Type: New feature | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nikita Marchant):
* owner: Daniel Samuels => Nikita Marchant
Comment:
Hi!
It looks like Daniel
[https://github.com/django/django/pull/14995#issuecomment-989645451 does
not have time] to handle this ticket so i would like to have a try.
I spent a little time thinking about the best way to do this and I see a
few options:
1. Write a decorator that makes the function accept positional arguments,
sends a warning and rewrites the call to using kwargs only
([https://paste.awesom.eu/62le Proof of concept])
2. Add `*args` to the signature and use a trick with `locals()` to inject
those into the local variables ([https://paste.awesom.eu/WqQ8 Proof of
concept], thanks to [https://github.com/t00n t00n] for the idea and code)
3. Change the signature to `__init__(self, *args, **kwargs)`
1 and 2 have the advantage of not changing the signature and body of the
function too much so it will be easy to remove when the depreciation
period ends but are using maybe too much of dark magic. 3 is the opposite.
What do you think would be best in Django's case ? When i know what
approach to take, i'd be happy to update
[https://github.com/django/django/pull/14995 Daniel's PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/33199#comment:10>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/071.33705f8f73e899909d88331509df4945%40djangoproject.com.