#17814: Make calling a cached method independent of source code inspection
-------------------------------------+-------------------------------------
       Reporter:  SimonKing          |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.6
      Component:  distribution       |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Simon King         |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  
u/SimonKing/make_calling_a_cached_method_independent_of_source_code_inspection| 
 a0b829dc10b4ccb00b99e073de8a1c0006aa1e51
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jdemeyer):

 Replying to [comment:51 SimonKing]:
 > I think that the current branch does not have a high danger of creating
 subtle caching problems. First of all, with the branch, a change in
 behaviour can only occur when we have a cached method-with-default-
 arguments-and/or-args/kwds of a cdef class whose source file is not
 available. Methods without arguments will be totally fine if the source
 file is gone (so, the branch does fix a problem).
 Proposal [comment:15] also has that property.

 > A change in behaviour would most likely be a problem where coercion is
 involved, i.e., in `UniqueRepresentation`. But there, we are safe, since
 (a) sub-classes of `UniqueRepresentation` must be Python classes anyway
 (and Python classes aren't affected by the bug), and (b)
 `UniqueRepresentation.__classcall__` has generic arguments `*args,**kwds`.
 Python classes would be unaffected by proposal [comment:15].

 > If you think that it is too dangerous to silently change behaviour
 rather than raise a straight forward error, we could instead raise a
 warning (only once, similar to deprecation warnings) when a cached method
 is called on a method whose argspec can't be determined.
 I think we need to agree first on whether the uniquess property for Cython
 cached methods is important.

 1. If uniqueness is important, then it is indeed "too dangerous to
 silently change behaviour". ==> Go with the solution of Nils to somehow
 put the argspec information in the docstring and use that.

 2. If uniqueness is not important, then why bother reading the argspec
 anyway? ==> Proposal [comment:15]

--
Ticket URL: <http://trac.sagemath.org/ticket/17814#comment:53>
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.

Reply via email to