#6700: smart_decorator util
---------------------------+------------------------------------------------
Reporter: SmileyChris | Owner: SmileyChris
Status: closed | Component: Core framework
Version: SVN | Resolution: wontfix
Keywords: | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------+------------------------------------------------
Changes (by mtredinnick):
* status: assigned => closed
* resolution: => wontfix
Comment:
I don't think this is worth it. Code like this has uses sometimes, but, in
general, it's just an extra layer of complexity that people have to
understand when trying to debug this stuff. If there are specific cases
that really need this sort of handling, then we can fix them with a couple
of lines of code as we've done in login_required (and I'd much prefer to
see sticking to keyword args there, rather than positional parameters as
it rules out the chance of confusion).
In general, if a decorator takes parameters, it should always be called in
one way. Historically, we have a couple of cases where that rule is broken
in Django and have chosen to work around them, rather than break
everybody's code, but it's not worth encouraging it in general. It's
usually poor style (polymorphous function calls are generally confusing
because you have to work out which signature is being applied) and make
maintenance harder.
--
Ticket URL: <http://code.djangoproject.com/ticket/6700#comment:2>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---