[Python-3000] Builtin iterator type

2006-11-13 Thread George Sakkis
Following up on a recent c.l.py thread (http://groups.google.com/group/comp.lang.python/browse_frm/thread/42818717b400bcd4/#), I'd like to get an idea from python-dev folks on how much of a chance is there for a builtin iterator type. Although there might be a slight possibility to make this propos

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Guido van Rossum
Hm. Without knowing much of the background, this appears to be a worrysome trend away from duck typing. Why would I have to inherit from a standard class just so that I can implement next()? What's the advantage of the proposed change? Are you going to propose similar changes for all standard de-fa

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Bill Janssen
> this appears to be a worrysome trend away from duck typing Duck typing is a seriously bad idea, forced on Python by the now obsolete split between built-in types and user-defined types. > Are you going to propose similar > changes for all standard de-facto interfaces, like sequences, > mappings

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Jean-Paul Calderone
On Mon, 13 Nov 2006 14:51:29 PST, Bill Janssen <[EMAIL PROTECTED]> wrote: >> this appears to be a worrysome trend away from duck typing > >Duck typing is a seriously bad idea, forced on Python by the now >obsolete split between built-in types and user-defined types. Wow. Just wow. Anyway, the pr

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread George Sakkis
On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Hm. Without knowing much of the background, this appears to be a > worrysome trend away from duck typing. Why would I have to inherit > from a standard class just so that I can implement next()? What's the > advantage of the proposed chang

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread George Sakkis
On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > [Adding back python-3000 -- I'm not going to have private conversations] Sorry, I accidentally hit reply instead of reply-all; I realized it a minute later and I sent a cc to the list but it hasn't appeared yet.. strange. > On 11/13/06,

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Guido van Rossum
[Adding back python-3000 -- I'm not going to have private conversations] On 11/13/06, George Sakkis <[EMAIL PROTECTED]> wrote: > On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > Hm. Without knowing much of the background, this appears to be a > > worrysome trend away from duck typing

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Brian Harring
On Mon, Nov 13, 2006 at 01:44:10PM -0500, George Sakkis wrote: > As a proof of concept, I provide below a sample implementation of how > I imagine this type to work (also posted in the original c.l.py. > thread): > > from itertools import chain, tee, islice > > import __builtin__ > _builtin_iter =

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Guido van Rossum
As my final word, I think this is a seriously bad idea, and as you're not answering my challenge about duck typing I don't think you understand your own proposal. On 11/13/06, George Sakkis <[EMAIL PROTECTED]> wrote: > On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > [Adding back pyt

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread George Sakkis
On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > As my final word, I think this is a seriously bad idea, and as you're > not answering my challenge about duck typing I don't think you > understand your own proposal. I think I do, though I can't tell the same about the reasons of your ob

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Alexander Belopolsky
George Sakkis gmail.com> writes: ... > As for the duck typing, I mentioned already that nobody forces you to > extend this type to make some class an iterator, as nobody forces you > to extend dict or dictmixin to write a user-defined mapping. You may > well start from scratch implementing just ne

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Guido van Rossum
On 11/13/06, George Sakkis <[EMAIL PROTECTED]> wrote: > On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > As my final word, I think this is a seriously bad idea, and as you're > > not answering my challenge about duck typing I don't think you > > understand your own proposal. > > I thi

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread George Sakkis
On 11/13/06, Brian Harring <[EMAIL PROTECTED]> wrote: > Tend to think __getitem__ on base iter is a rather bad idea due to the > fact it implies the underlying iter is a mapping; it's not. Only mappings define __getitem__ ?!? Now that's a new one. > Additionally... islice *does* have issues when

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread Ronald Oussoren
On 14 Nov 2006, at 4:26 AM, George Sakkis wrote: I honestly fail to understand your current objections. Is my analogy with dictmixin flawed ? Would anything change if I named it "itermixin" instead of iter or Iter ? I'm ok with the idea being rejected, but at least I'd like to understand the

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread George Sakkis
On 11/14/06, Ronald Oussoren <[EMAIL PROTECTED]> wrote: > > On 14 Nov 2006, at 4:26 AM, George Sakkis wrote: > > > > > I honestly fail to understand your current objections. Is my analogy > > with dictmixin flawed ? Would anything change if I named it > > "itermixin" instead of iter or Iter ? I'm

Re: [Python-3000] Builtin iterator type

2006-11-13 Thread George Sakkis
On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 11/13/06, George Sakkis <[EMAIL PROTECTED]> wrote: > > I honestly fail to understand your current objections. Is my analogy > > with dictmixin flawed ? Would anything change if I named it > > "itermixin" instead of iter or Iter ? I'm ok