PEP 246... Why does Python have to support every pattern out there?

Clark C. Evans cce at clarkevans.com
Wed Apr 4 08:35:29 EDT 2001


On Sun, 1 Apr 2001, Alex Shindich wrote:
> While I understand the value of bi-directional adaptors, I
> really do not see the reason for adding support for this 
> pattern to the language.

Bi-directional adapters are a very powerful pattern for
connecting components from different vendors.  It can be used
to shift the burden of protocol compliance from the average
user to the library developers, greatly enhancing code-reuse.

> 1. This pattern can be implemented as a stand alone base class.

The primary value of the pattern is its affect on the "marketplace"
as it gives component vendors a mechanism to communicate that
is currently unavailable.  This pattern (the adapt function) is
by its very design a singelton. 

> 2. The definition of the interface/context is very vague. This limits the
> ability to clearly identify the interfaces.

This is not in the scope of the PEP.  PEP 245 (Interfaces) 
defines the concept of interface.

This proposal, PEP 246 is explicitly vague in this regard.

> 3. I am also worried about the versioning problems. COM resolves this
> problem by uniquely identifying each version of each interface with a
> GUID. Java resolves the problem by using unique class names. Are there
> going to be any rules for versioning here?

This is also not in the scope of this PEP.  

> 4. Do we know how often this feature will be used? Why not create a module
> that implements the pattern and see if it is being used. And only then
> possibly migrate the feature into the language. This worked well for
> PyUnit.

Agreed.  I'm just very short on time at the moment.

Clark





More information about the Python-list mailing list