Re: PEP 246 revision

2005-03-13 Thread boisgera
Have you read the BDFL's Python Optional Typechecking Redux ? Yes. (http://www.artima.com/weblogs/viewpost.jsp?thread=89161) It's usage of adapt assumes that a class is a protocol, so I guess that it does not work with the new version of PEP 246. Why not? There's nothing wrong with

Re: PEP 246 revision

2005-03-08 Thread Magnus Lie Hetland
In article [EMAIL PROTECTED], S?bastien Boisg?rault wrote: [snip] Agreed. Consistency matters. But precisely because Python looks in the type of the object (and not the object itself), I don't need to explicitely check the type myself: the code adapt = getattr(protocol, '__adapt__') will find

Re: PEP 246 revision

2005-03-06 Thread S?bastien Boisg?rault
[EMAIL PROTECTED] (Magnus Lie Hetland) wrote in message news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: I had a look at the new reference implementation of PEP 246 (Object Adaptation) and I feel uneasy with one specific point of this new version. I don't

Re: PEP 246 revision

2005-03-04 Thread Magnus Lie Hetland
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: I had a look at the new reference implementation of PEP 246 (Object Adaptation) and I feel uneasy with one specific point of this new version. I don't fully understand why it checks if *the type of* the protocol has a method __adapt__: