Re: [Python-3000] Python-3000 Digest, Vol 9, Issue 27

2006-11-14 Thread Bill Janssen
> The real > problem is that iterator is an interface, and there's no formal way to > express interfaces in Python; it's all in the documentation. > ... > The problem with .__getitem__ is, you can't tell whether an object is > a sequence or a mapping. If it has .__getitem__, it's one or the > othe

Re: [Python-3000] Python-3000 Digest, Vol 9, Issue 27

2006-11-14 Thread Mike Orr
On 11/14/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Having a rich method API vs having a narrow method API and duck-typed support > functions is a design trade-off. In the case of sequences and mappings, the > trade-off went towards a richer API because the de facto reference > implementations w

Re: [Python-3000] Python-3000 Digest, Vol 9, Issue 27

2006-11-14 Thread Nick Coghlan
George Sakkis wrote: > On 11/14/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >> BJ?rn Lindqvist wrote: >> >>> But why is both the dict and list protocol so fat then? Is it hard to >>> create your own dict or list-derived types in Python? >> don't confuse things like lists and dictionaries with t

Re: [Python-3000] Python-3000 Digest, Vol 9, Issue 27

2006-11-14 Thread George Sakkis
On 11/14/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > BJ?rn Lindqvist wrote: > > > But why is both the dict and list protocol so fat then? Is it hard to > > create your own dict or list-derived types in Python? > > don't confuse things like lists and dictionaries with things like > sequences and

Re: [Python-3000] Python-3000 Digest, Vol 9, Issue 27

2006-11-14 Thread Fredrik Lundh
George Sakkis wrote: >> don't confuse things like lists and dictionaries with things like >> sequences and mappings. iterators and iterables belong to the second >> category. > > This doesn't answer my last question: why do we need itertools when we > can live without sequencetools, mappingtools,