On Feb 9, 2007, at 11:28 PM, William Stein wrote:
> > On Fri, 09 Feb 2007 16:18:16 -0700, David Harvey > <[EMAIL PROTECTED]> wrote: > >> BTW that ell_rational_field.py is getting kind of ridiculously big. > > Indeed! It desparately needs to be broken up. I think the best > way is to do this: > > > class EllipticCurve_rationals_0(...): # name may change > lots of not-to-special functions > [...] > > and only objects of type EllipticCurve_rational_field are ever made. > > This is precisely the sort of thing I did with matrices and it has > worked > out very well. It will also help make the documentation more > readable. You do take a tiny performance hit doing it this way. Every time python needs to look up a method on an object, it needs to work its way through each of the parent classes' hash tables. (I think. Not 100% sure.) But I don't see any other way of doing it. Python unfortunately doesn't have "#include". David --~--~---------~--~----~------------~-------~--~----~ 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-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---
