#16607: Enforce keyword-only parameters
-------------------------------+------------------------
Reporter: gagern | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.3
Component: misc | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------+------------------------
Comment (by gagern):
Replying to [comment:2 nbruin]:
> -1 for performance reasons. Calls in python are expensive and wrappers
installed by decorators add a call level. And sage tends to have a ''lot''
of calls already, so these costs quickly add up.
I am thinking about things which are unlikely to be used in a tight loop.
Front ends to costly operations, mostly. In those case, the extra cost
would be negligible compared to the typical cost of the function
execution. I certainly wouldn't want to add this decorator to ''every''
function that might syntactically qualify, exactly due to these
performance issues. I'd say the decorator should only be used if there is
considerable gain associated with dropping a positional parameter.
> There would be a way to have both: have a flag set at startup that
determines whether the decorator puts a check in place or just returns the
original function. I'm afraid that's too complicated to be used in
practice, though, but you could try.
This might help when policing uses within Sage itself. My main concern
however was user interaction. If we leave them an officially sanctioned
option to disable the checks, then we might be responsible to maintain
compatibility with deprecated syntax indefinitely. Unless we have the
checks in place by default and make a very clear statement that people
must assume responsibility if they decide to disable them. Checks enabled
by default would change little in terms of performance for most users.
--
Ticket URL: <http://trac.sagemath.org/ticket/16607#comment:3>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.