PEP 245

Alex Shindich shindich at itginc.com
Wed Apr 4 19:57:10 EDT 2001


Sure.
Except that PEP 246 is meant to operate on anything at all, which happens to
include the interfaces.
In fact, as it was pointed out to me by Clark Evans, the PEP suggests an
implementation for a bi-directional adapter pattern.
(Although I did point out in the past that it looks very similar to
QueryInterface with very vague definition of the interface. The subject of
the relationship between PEP 245 and QueryInterface is discussed in PEP's
text.)
PEP 246 does not guarantee the symmetric behavior, which I think is required
for going back and forth between object's interfaces. Although the PEP says
that such behavior may be added. (See PEP's text)

But all in all, PEP 246 can be implemented in such  way that it satisfies
'__getinterfacereference__' requirements. But that needs to be the default
behavior for '__adapt__'.

-----Original Message-----
From: Clark C. Evans [mailto:cce at clarkevans.com]
Sent: Wednesday, April 04, 2001 4:37 PM
To: Alex Shindich
Cc: python-list at python.org
Subject: Re: Re: PEP 245


On Wed, 4 Apr 2001, Alex Shindich wrote:
> I see your point. But I think that proposed interface behavior is
> missing a very important attribute -- an explicit facility for
> acquiring interface references.

This can be done with PEP 246

Clark






More information about the Python-list mailing list