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
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
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.
>>
>
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
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
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
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