On Mon, Jul 13, 2009 at 8:14 AM, David Roe<r...@math.harvard.edu> wrote:
> Currently there are no classes in sage inheriting form PowerSeries other
> than PowerSeries_poly.  But one could write a lazy power series class that
> used the same basic interface as PowerSeries, using lists or python
> functions, and define "class PowerSeries_lazy(PowerSeries)".  I think that's
> the distinction.

Aha, that makes sense.  So here's my problem: I'm working on trac 111,
i.e. change all the  .copy() methods to __copy__().  Having done this
in power_series_poly.pyx, I am now getting a doctest failure in
power_series_ring_element.pyx, namely

sage: copy(f) is f       # !!! ok since power series are immutable.
Expected:
    True
Got:
    False


This is because PowerSeries already has a __copy__() method which just
returns self, while the __copy__() method of PowerSeries_poly actually
returns a copy.  The doctest is failing because f is a
PowerSeries_poly and hence the derived method is used.

So I'm not sure what to do.  I cannot change the doctest because I
can't construct a PowerSeries which is not a PowerSeries_poly.  My
thought now is to make PowerSeries.__copy__() return
NotImplementedError and have all derived classes override it.

Is this reasonable?  Is there a better solution I don't see now?

Best,
Alex

-- 
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
-- Australia -- http://www.ms.unimelb.edu.au/~aghitza/

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to