Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Terry Reedy
Christian Heimes wrote: Sets are basically dicts without values. For CPython true, but abstractly, dicts are sets with values, and mappings are often viewed as sets of key,value pairs. -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Christian Heimes
Stephen Hansen schrieb: > Now, I believe Python sets *are* for all intents and purposes > dictionaries, but I think that's just because its the easiest and most > efficient way to implement their uniqueness properties; they took the > very-well-tuned dictionary implementation and cut out the stuff

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Christian Heimes
er schrieb: > Somebody much more intelligent than I said today that someone told him that > Python lists are just dictionaries with lists hashed by integers. Since he > said that someone else told him this, I piped up and said that I thought > that wasn't true. I looked at the source code for lis

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Gabriel Genellina
En Sat, 07 Feb 2009 01:18:37 -0200, er escribió: Somebody much more intelligent than I said today that someone told him that Python lists are just dictionaries with lists hashed by integers. In addition to all other responses you received, I'd add that lists and dictionaries share the same

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Gabriel Genellina
En Sat, 07 Feb 2009 01:18:37 -0200, er escribió: Somebody much more intelligent than I said today that someone told him that Python lists are just dictionaries with lists hashed by integers. In addition to all other responses you received, I'd add that lists and dictionaries share the same

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Terry Reedy
er wrote: Somebody much more intelligent than I said today that someone told him that Python lists are just dictionaries with lists hashed by integers. Abstractly, which is to say, behaviorally, a Python list is a sequence class as defined under Built-in Types in the Library manual. Diction

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Stephen Hansen
On Fri, Feb 6, 2009 at 7:32 PM, er wrote: > Thanks Chris. Lua tables are one of my favorite linguistic traits, which > was actually part of the discussion that brought up this nugget. > Nevertheless, any details you care to provide about the details. I'm going > to dive into the source code in m

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Chris Rebert
> On Fri, Feb 6, 2009 at 10:25 PM, Chris Rebert wrote: >> On Fri, Feb 6, 2009 at 7:18 PM, er wrote: >> > Somebody much more intelligent than I said today that someone told him >> > that >> > Python lists are just dictionaries with lists hashed by integers. Since >> > he >> > said that someone el

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread er
Thanks Chris. Lua tables are one of my favorite linguistic traits, which was actually part of the discussion that brought up this nugget. Nevertheless, any details you care to provide about the details. I'm going to dive into the source code in more depth tomorrow, just so I can get a better unde

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Chris Rebert
On Fri, Feb 6, 2009 at 7:18 PM, er wrote: > Somebody much more intelligent than I said today that someone told him that > Python lists are just dictionaries with lists hashed by integers. Since he > said that someone else told him this, I piped up and said that I thought > that wasn't true. I lo

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread er
Correction, the first sentence should read, "lists are just dictionaries keyed with integers." On Fri, Feb 6, 2009 at 10:18 PM, er wrote: > Somebody much more intelligent than I said today that someone told him that > Python lists are just dictionaries with lists hashed by integers. Since he >

Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread er
Somebody much more intelligent than I said today that someone told him that Python lists are just dictionaries with lists hashed by integers. Since he said that someone else told him this, I piped up and said that I thought that wasn't true. I looked at the source code for lists in python, and I