#19886: remove misleading line in FormalSums
-------------------------------------+-------------------------------------
       Reporter:  mantepse           |        Owner:
           Type:  defect             |       Status:  positive_review
       Priority:  major              |    Milestone:  sage-7.0
      Component:  algebra            |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Martin Rubey       |    Reviewers:  Daniel Krenn
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/mantepse/remove_misleading_line_in_formalsums|  
fc1a04fec406551e6225cfa6e5cbee44bcb9f875
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Description changed by slelievre:

Old description:



New description:

 As discussed in [https://groups.google.com/d/topic/sage-
 devel/09Xf1_coMOc/discussion this sage-devel discussion], the "elif"
 branch in this excerpt can never be visited, since if its condition was
 satisfied, the "if" condition would have been too, and the method would
 have ended with the "return" statement in the "if" branch.

 {{{
 class FormalSums(UniqueRepresentation, Module):

     Element = FormalSum

     def _element_constructor_(self, x, check=True, reduce=True):

         if isinstance(x, FormalSum):
             P = x.parent()
             if P is self:
                 return x
             elif P == self:
                 return self.element_class(x._data, check=False,
 reduce=False, parent=self)
             else:
                 x = x._data
 }}}

 We therefore remove the "elif" branch which can only cause confusion.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/19886#comment:7>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to