#8899: Implement non commutative symmetric functions
--------------------------------------------------------------------------------+
       Reporter:  nthiery                                                       
|         Owner:  sage-combinat                             
           Type:  enhancement                                                   
|        Status:  closed                                    
       Priority:  major                                                         
|     Milestone:  sage-5.4                                  
      Component:  combinatorics                                                 
|    Resolution:  fixed                                     
       Keywords:  sd40                                                          
|   Work issues:                                            
Report Upstream:  N/A                                                           
|     Reviewers:  Mike Zabrocki, Franco Saliola, Mike Hansen
        Authors:  Jason Bandlow, Chris Berg, Franco Saliola, Nicolas M. ThiƩry  
|     Merged in:  sage-5.4.beta1                            
   Dependencies:  #12953, #12956, #12959, #13238, #13243, #5457                 
|      Stopgaps:                                            
--------------------------------------------------------------------------------+

Comment (by jdemeyer):

 This is a better example from this patch on how ''not'' to use assert:
 {{{
             try:
                 assert self.is_homogeneous()
                 return
 self.parent().degree_on_basis(self.leading_support())
             except AssertionError:
                 raise ValueError("Element is not homogeneous.")
 }}}

 And this is an easily made mistake, it should give a `TypeError`:
 {{{
 def from_polynomial(self, f, check=True):
     ...
     assert self.base_ring() == f.base_ring()
 }}}
 You could even do:
 {{{
 if check and self.base_ring() != f.base_ring():
     raise TypeError(...)
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8899#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 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.

Reply via email to