Re: [Python-3000] Adaptation: T->P vs P->P

2006-04-04 Thread Nick Coghlan
Tim Hochberg wrote: > Michael Chermside wrote: >> Tim's proposal (if I understand it correctly) depends on transitivity -- >> his idea is to have the class authors register as satisfying a small >> number of widely-known protocols (Psrc in his case), >> > Yes. > > >> then use transitivity >> to i

Re: [Python-3000] Adaptation: T->P vs P->P

2006-04-03 Thread Greg Ewing
Michael Chermside wrote: > But if we were to infer that > anything satisfying "python.as_int" necessarily satisfied "python.as_index", > then we would have defeated the purpose of the feature. We just need to keep a clear distinction between "is an integer" and "convertible to an integer". Python

Re: [Python-3000] Adaptation: T->P vs P->P

2006-04-03 Thread Tim Hochberg
Michael Chermside wrote: >Tim Hochberg writes: > > >>In this thread, Alex has been advocating adaption where types are >>adapted to protocols: T->P adaption for short. By contrast, my two >>sample implementations have involved Protocol->Protocol adaption >>[...] P->P adaption for short. >> >

Re: [Python-3000] Adaptation: T->P vs P->P

2006-04-03 Thread Michael Chermside
Tim Hochberg writes: > In this thread, Alex has been advocating adaption where types are > adapted to protocols: T->P adaption for short. By contrast, my two > sample implementations have involved Protocol->Protocol adaption > [...] P->P adaption for short. > However, there is a huge difference in

Re: [Python-3000] Adaptation: T->P vs P->P

2006-04-03 Thread Tim Hochberg
Nick Coghlan wrote: [SNIP] > > Tim Hochberg wrote: > >>In this thread, Alex has been advocating adaption where types are >>adapted to protocols: T->P adaption for short. By contrast, my two >>sample implementations have involved Protocol->Protocol adaption where >>objects that implement a cert

Re: [Python-3000] Adaptation: T->P vs P->P

2006-04-03 Thread Nick Coghlan
FWIW, I went back and read PEP 246. That PEP goes to great lengths to permit arbitrary objects to be used as protocols, with the process of checking for compliance being a bit of a tap dance back and forth between the object and the protocol. Great effort was also put into registering adaptabili

Re: [Python-3000] Adaptation: T->P vs P->P

2006-04-02 Thread Tim Hochberg
In this thread, Alex has been advocating adaption where types are adapted to protocols: T->P adaption for short. By contrast, my two sample implementations have involved Protocol->Protocol adaption where objects that implement a certain protocol are adapted to another protocol: P->P adaption f