Thought on PEP 204 and 276
phil hunt
philh at comuno.freeserve.co.uk
Tue May 28 15:31:16 EDT 2002
On Tue, 28 May 2002 16:00:12 +0200, holger krekel <pyth at devel.trillke.net> wrote:
>
>that was precisely my argument on the python-dev list but
>it got rejected by GvR personally ... "Trust me. Don't go there."
>
>I realize that mapping types and sequence types are quite different
>despite appearances. It may not be a good idea to blur the lines
>between these two too much.
I think they are essentially the same. A sequence tpye is just a
mapping type where the keys are restricted to the integers from
0 to however many elements there are minus 1.
>> Also, why wasn't an items() method simply added to sequence types,
>> treating them as mapping types with an integer key?
>
>that would be ambivalent. calling items on a list could also mean
>that you are refering to the elements (no notion of enumeration).
but then you would just say
for element in list:
--
<"><"><"> Philip Hunt <philh at comuno.freeserve.co.uk> <"><"><">
<"><"><"> My website has moved -- new address is: <"><"><">
<"><"><"> <http://www.comuno.freeserve.co.uk/> <"><"><">
More information about the Python-list
mailing list