#20062: Make _floordiv_() for power series a deprecated alias for _div_()
-------------------------------------+-------------------------------------
       Reporter:  pbruin             |        Owner:
           Type:  task               |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-7.1
      Component:  algebra            |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Peter Bruin        |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/pbruin/20062-PowerSeries_floordiv|  e9719f7399ffab100407a360c16fe0596e7f2689
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by bruno):

 A proposal along the line of my previous comment would be as follows:

 {{{#!python
     cpdef RingElement _floordiv_(self, RingElement denom):
         """
         ...
         """
         from sage.misc.superseded import deprecation
         try:
             deprecation(20062, "the operator // now performs a euclidean
 division for power series over fields,      use / instead to perform a
 (true) division")
             return self.quo_rem(denom)[0]
         except AttributeError, NotImplementedError:
             deprecation(20062, "the operator // is deprecated for power
 series over non-fields, use / instead")
             return self._div_(denom)
 }}}

 Testing this code, I get a deprecation warning about deprecation warnings
 so it is probably not the right way to write this:

 {{{#!python
 /opt/sage/local/lib/python2.7/site-packages/IPython/core/formatters.py:92:
 DeprecationWarning: DisplayFormatter._ipython_display_formatter_default is
 deprecated: use @default decorator instead.
 }}}

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