Hi Minh, On 24 Aug., 02:10, Minh Nguyen <[email protected]> wrote: [...] > > Since I am not an experienced programmer: Are there reasons to not use > > a dictionary for those kind of things? > > A good point: searching through a dictionary is essentially constant time. > > A bad point: can't assume that each key/value pair in a dictionary > would always be ordered in exactly the same way. This assumption was > uncovered during the development of Sage 4.1.1 when a doctest failed. > The cause of the failure: the doctest assumed that printing the > key/value pairs of a dictionary would always result in exactly the > same arrangement of key/value pairs. Bad assumption there.
But you couldn't use the attribute "._properties" in doc tests anyway, because AFAIK rings are cdef classes, so, you can't access the attributes on a python level. However, you can call the methods "is_field()", "is_integrally_closed ()" etc, which would reflect the ccontent of "._properties". Cheers Simon --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
