#5405: [with patch, needs work] create a decorator for adding default keyword
arguments to a function
---------------------------+------------------------------------------------
Reporter: mhansen | Owner: cwitty
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-4.2
Component: misc | Keywords:
Work_issues: | Author:
Reviewer: | Merged:
---------------------------+------------------------------------------------
Old description:
> The typical usage of this decorator would be to be applied above a
> :obj:`cached_method` or :obj:`cached_function` decorator so that
> the correct cached object is returned.
New description:
The typical usage of this decorator would be to be applied above a
:obj:`cached_method` or :obj:`cached_function` decorator so that
the correct cached object is returned.
--
Comment(by nthiery):
Thanks much for pointing out functools.partial and functool.wrapper; I
have several other use cases for them!
Replying to [comment:14 timdumol]:
> Perhaps a name of `curry` [1] would be better, since it prevents name
collision with functools.partial? Then again, it supersedes
functools.partial anyways.
>
> [1] http://en.wikipedia.org/wiki/Currying
I prefer partial, since curry does not really encompass the specialization
of named arguments.
It's really functools.partial, but made into a decorator.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5405#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---