On 21/02/2008, William Stein <[EMAIL PROTECTED]> wrote: > > On Thu, Feb 21, 2008 at 10:43 AM, John Cremona <[EMAIL PROTECTED]> wrote: > > > > OK, that makes sense to me (used to private data in C++ classes). > > Here the owning class is an ellipti curve, but I want points on that > > curve to access the "private" data. In C++ this would be done by > > decalring tha points were "friends" of curves. But here, I guess the > > correct thing is for other classes to use the full name, in this case > > _EllipticCurve_finite_field__order > > > > > I avoid using that at all ever, since it is so brittle. Usually when you're > doing this sort of thing you're writing code that is going to break later > when you or somebody else tries to change it -- so make sure you put > in some clear comments! > > You can use a single underscore to indicate "private-ish, but not so > private", e.g., change self.__order to self._order and then there will > be no name mangling. But users still no they aren't supposed to > muck with order.
That sounds like a good idea. Otherwise I would have to put in a method called order_if_known() which returns None if not yet computed. The point here is that it is much quicker computing the orders of points is the group order is known and also its factorization, so these are cached. But we must also be able to compute orders of point before the group order is known, since this is how cardinality() is implemented for non-prime fields. This started when I tried to see what I could do about #351. But any new patches would have to be made against 2.10.2 which will require me to download and build the latest rc, and that is unlikely to have finished before my bedtime (it takes about 3hrs for me which is the main reason I have not tested alphas and rcs yet). John > > > William > > > > > -- John Cremona --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com 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://www.sagemath.org -~----------~----~----~----~------~----~------~--~---