#13723: Moving hamming_weight from sage.coding to sage.modules
-------------------------------------------------+--------------------------
       Reporter:  tfeulner                       |         Owner:  wdj     
           Type:  enhancement                    |        Status:  new     
       Priority:  minor                          |     Milestone:  sage-5.6
      Component:  coding theory                  |    Resolution:          
       Keywords:  Hamming weight, coding theory  |   Work issues:          
Report Upstream:  N/A                            |     Reviewers:          
        Authors:                                 |     Merged in:          
   Dependencies:                                 |      Stopgaps:          
-------------------------------------------------+--------------------------

Comment (by ppurka):

 You need to deprecate the top level function (which you have already done)
 and not remove it entirely. The removal can happen after the deprecation
 period is over (typically 1 year).

 Anyway, the question is whether it should be deprecated. There is nothing
 wrong with having it both as `v.hamming_weight()` and as a global function
 `hamming_weight(v)`. In the latter case, you could modify the function to
 use the attribute if it is available:
 {{{
 #!python
 def hamming_weight(v): # the function in sage/coding/
     try:
         return v.hamming_weight()
     except AttributeError:
         # the old code comes here
 }}}

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