[Python-3000] Discussions with no PEPs

Talin talin at acm.org
Thu Mar 8 23:07:21 CET 2007


Bill Janssen wrote:
>> In any case, I would like to know, what is the current status of the 
>> following issues:
>>
>>    -- Generic Functions
>>    -- Interfaces
>>    -- Metaclass syntax
>>
>> It's not my intention to start a big thread about these
> 
> I don't see how you can avoid it -- that's the reason there's no PEP.

What I mean is, that I don't want to start the big thread *just yet*, 
and when I do, I want it to be in the proper place. Specifically, if 
there's a lot of unsettled issues and controversies, then probably we 
should move it to python-ideas; On the other hand, if it's just a matter 
of wrapping up a few details, then it should be taken up here.

> I'd be happy to take this discussion up again.  For those who don't
> remember, I believe that the existing multiple-inheritance object
> system gives us a reasonable way to define standard sets of operations
> (interfaces) which are provided to new types through the existing
> inheritance system, not some additional side-tagging mechanism.  I
> further believe that a standard set of base types (interfaces) should
> be designed and put into P3 as soon as possible, and that all the
> standard built-in types should be either one of these base types, or
> composed from several of them.  This approach has apparently been
> identified as ABC, standing for "abstract base classes", though the
> amount of abstractness that's necessary is debatable -- I've seen
> schemes like this where the base classes include working default
> implementations of the underlying semantics.
> 
> There's an incomplete wiki page about a possible factoring of types at
> http://wiki.python.org/moin/AbstractBaseClasses.
> 
> I further believe that relying on so-called "duck typing" runtime
> partial information probes is a fragile and error-prone way to build
> software, and that it should be deprecated in favor of "supports this
> interface" tests.

I think that you need to be careful here in order that you aren't 
misunderstood. I believe what you are specifically against is the use of 
*introspective* duck typing - in other words, using duck typing to 
deduce certain characteristics of a class, without any a priori 
knowledge of that class; This is distinct from duck typing in the 
general case, where you are calling a method on an object, not 
introspecting it. The latter is an essential part of Python, and any 
attempt to deprecate it is not only likely to fail, but will probably 
elicit enough of a defensive reaction as to drown out your other points.

> I've got no opinion (yet :-) on metaclass syntax.
> 
> How do we make progress on getting this into Py3K?
> 
> Bill
> 


More information about the Python-3000 mailing list