#15138: BuiltinFunction._is_registered is giving false negatives
-----------------------------+-------------------------
       Reporter:  ohanar     |        Owner:
           Type:  defect     |       Status:  new
       Priority:  major      |    Milestone:  sage-5.12
      Component:  symbolics  |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+-------------------------
Changes (by ohanar):

 * cc: burcin (removed)


Comment:

 The following seems to fix the issue:
 {{{
 #!diff
 @@ -853,18 +853,12 @@ cdef class BuiltinFunction(Function):

          # if match, get operator from function table
          global sfunction_serial_dict
 -        if serial != -1 and sfunction_serial_dict.has_key(self._name) and
 \
 -                sfunction_serial_dict[self._name].__class__ ==
 self.__class__:
 +        if serial != -1 and sfunction_serial_dict.has_key(serial) and \
 +                sfunction_serial_dict[serial].__class__ ==
 self.__class__:
                      # if the returned function is of the same type
                      self._serial = serial
                      return True

 -        # search the function table to check if any of this type
 -        for key, val in sfunction_serial_dict.iteritems():
 -            if key == self._name and val.__class__ == self.__class__:
 -                self._serial = key
 -                return True
 -
          return False

      def __reduce__(self):
 }}}


 I don't know the code, so I don't know what other implications this change
 might have (I didn't run the test suite).

--
Ticket URL: <http://trac.sagemath.org/ticket/15138#comment:2>
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/groups/opt_out.

Reply via email to