Re: [Python-3000] ABC method mismatch

2008-02-07 Thread Alexander Belopolsky
Raymond Hettinger rcn.com> writes: > > [Fred Drake] > > I'd be happy seeing these methods added to tuple; there's > > no reason that they would only be useful on mutable sequences. > Note that adding index and count to tuple will conflict with using these names as attributes in classes generat

Re: [Python-3000] ABC method mismatch

2008-02-06 Thread Guido van Rossum
On Feb 6, 2008 5:21 PM, Aahz <[EMAIL PROTECTED]> wrote: > On Wed, Feb 06, 2008, Guido van Rossum wrote: > > On Feb 6, 2008 2:58 PM, Fred Drake <[EMAIL PROTECTED]> wrote: > >> > >> I'd be happy seeing these methods added to tuple; there's no reason > >> that they would only be useful on mutable sequ

Re: [Python-3000] ABC method mismatch

2008-02-06 Thread Aahz
On Wed, Feb 06, 2008, Guido van Rossum wrote: > On Feb 6, 2008 2:58 PM, Fred Drake <[EMAIL PROTECTED]> wrote: >> >> I'd be happy seeing these methods added to tuple; there's no reason >> that they would only be useful on mutable sequences. > > Sounds like this is the consensus. Go for it, Raymond

Re: [Python-3000] ABC method mismatch

2008-02-06 Thread Raymond Hettinger
[Fred Drake] > I'd be happy seeing these methods added to tuple; there's > no reason that they would only be useful on mutable sequences. That reminds me, I've always thought Sequence.__contains__(). should always be accompanied by Sequence.index(). Their use cases are strongly related: Good n

Re: [Python-3000] ABC method mismatch

2008-02-06 Thread Guido van Rossum
On Feb 6, 2008 2:58 PM, Fred Drake <[EMAIL PROTECTED]> wrote: > On Feb 6, 2008 2:29 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > Do you want to drop those methods from the ABC or add them to tuple? > > > On Feb 6, 2008, at 5:40 PM, Guido van Rossum wrote: > > I'm not sure, but I'm tempted t

Re: [Python-3000] ABC method mismatch

2008-02-06 Thread Fred Drake
On Feb 6, 2008 2:29 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > Do you want to drop those methods from the ABC or add them to tuple? On Feb 6, 2008, at 5:40 PM, Guido van Rossum wrote: > I'm not sure, but I'm tempted to add them to the ABC. What's your > Is Guido having a bad typing day?

Re: [Python-3000] ABC method mismatch

2008-02-06 Thread Raymond Hettinger
>> Do you want to drop those methods from the ABC or add them to tuple? > I'm not sure, but I'm tempted to add them to the ABC. > What's your hunch? My hunch is that adding count() and index() to tuple is at harmless at worst and sometimes helpful at best (I've occasionally needed them and felt m

Re: [Python-3000] ABC method mismatch

2008-02-06 Thread Guido van Rossum
On Feb 6, 2008 2:29 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > The tuple class is registered to the collections.Sequence ABC, but it does > not support count() and index() as required by the ABC. Good catch! > Do you want to drop those methods from the ABC or add them to tuple? I'm not

[Python-3000] ABC method mismatch

2008-02-06 Thread Raymond Hettinger
The tuple class is registered to the collections.Sequence ABC, but it does not support count() and index() as required by the ABC. Do you want to drop those methods from the ABC or add them to tuple? Raymond ___ Python-3000 mailing list Python-3000@py