Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Jeffrey Yasskin
On 4/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 4/20/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > > On Sets: > > Do you have an example of a data structure that is a Set but not a > > ComposableSet? > > Take for example a set that is a contiguous range of integers, > represented by

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Nick Coghlan
Guido van Rossum wrote: > I do see your point though: object.__hash__ makes it possible to use > all sorts of objects as dict keys by default, as long as they don't > implement __eq__. But perhaps this is not such a good idea and we > should just get rid of it and add __hash__ back to specific obje

Re: [Python-3000] Fixing super anyone?

2007-04-21 Thread Michele Cella
Guido van Rossum wrote: > >> There's also the question of what the super keyword itself should look like, >> e.g. >> >> # declaration-style, no dot >> res = super currentmethod(arg, arg) >> # treat super like self >> res = super.currentmethod (arg, arg) >> # treat super like self.current

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Guido van Rossum
On 4/21/07, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > I do see your point though: object.__hash__ makes it possible to use > > all sorts of objects as dict keys by default, as long as they don't > > implement __eq__. But perhaps this is not such a good idea and we > > sh

Re: [Python-3000] Fixing super anyone?

2007-04-21 Thread Michele Cella
Michele Cella wrote: > > Personally, I really like this syntax: > > res = super currentmethod(arg, arg) > Sorry for replying to myself, what about: def mymethod(self, arg): super self.mymethod(arg) this syntax resembles very closely the way you actually invoke a *self*

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Phillip J. Eby
At 12:33 PM 4/20/2007 -0700, Talin wrote: >Additionally, the need to override the classification of an >object can be done more cleanly using generic functions: In the simplest >case, one can define a "category membership" generic function that >simply returns False in the base implementation, and

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Guido van Rossum
On 4/21/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > On 4/20/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 4/20/07, Jeffrey Yasskin <[EMAIL PROTECTED]> wrote: > > > On Sets: > > > Do you have an example of a data structure that is a Set but not a > > > ComposableSet? > > > > Take for e

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Guido van Rossum
On 4/21/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 12:33 PM 4/20/2007 -0700, Talin wrote: > >Additionally, the need to override the classification of an > >object can be done more cleanly using generic functions: In the simplest > >case, one can define a "category membership" generic functi

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Nick Coghlan
Guido van Rossum wrote: > On 4/21/07, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> We've tried to do this before - the point where we got stuck was the >> fact that Jython needed a separate location to store the default hash >> method (unlike CPython, Jython's id() and object.__hash__() do different

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Phillip J. Eby
At 08:06 AM 4/21/2007 -0700, Guido van Rossum wrote: >On 4/21/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > At 12:33 PM 4/20/2007 -0700, Talin wrote: > > >Additionally, the need to override the classification of an > > >object can be done more cleanly using generic functions: In the simplest >

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Talin
John Reese wrote: > "This PEP proposes a particular strategy for organizing these tests > known as Abstract Base Classes, or ABC. ABCs are simply Python classes > that are added into an object's inheritance tree to signal certain > features of that object to an external inspector. Tests are done us

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread Jim Jewett
On 4/19/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 4/19/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > > On 4/19/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > I've started a PEP on Abstract Base Classes (ABCs), PEP 3119: > > * "Should we also implement the issubset and issuperset

Re: [Python-3000] Need help completing ABC pep

2007-04-21 Thread John Reese
On 4/19/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I've started a PEP on Abstract Base Classes (ABCs), PEP 3119: > > http://www.python.org/dev/peps/pep-3119/ > > While I'm not ready yet to answer tough questions about this compared > to alternative proposals, I *am* ready for feedback on