Implicit lists

David Eppstein eppstein at ics.uci.edu
Thu Jan 30 16:33:25 EST 2003


In article <Trg_9.106594$0v.3078122 at news1.tin.it>,
 Alex Martelli <aleax at aleax.it> wrote:

> Actually quite clear, but finding holes is more fun:-).
> 
> A dictionary, {1:2, 3:4, 5:6}, is a list of items separated
> by commas (the items are (1,2), (3,4), ...) -- how do you
> want to treat it?

My interpretation is sort of the opposite: a dictionary can represent 
any function with a finite domain, and a list is a special case of this 
where the domain of the function is a range of integers.

Of course this view breaks down once you start modifying dicts or lists, 
since the ways they change are not so similar...

-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/




More information about the Python-list mailing list