On Mon, Aug 24, 2009 at 6:21 AM, Simon King<simon.k...@nuigalway.ie> wrote:
>

<SNIP>

> I guess this would provide some flexibility, but I don't know if it
> would be a "clean" thing to do.
> 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.

-- 
Regards
Minh Van Nguyen

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an 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