[Python-3000] Need help completing ABC pep
John Reese
jtr at miskatonic.nu
Sat Apr 21 22:21:26 CEST 2007
On 4/19/07, Guido van Rossum <guido at python.org> wrote:
> I've started a PEP on Abstract Base Classes (ABCs), PEP 3119:
>
> http://www.python.org/dev/peps/pep-3119/
>
> While I'm not ready yet to answer tough questions about this compared
> to alternative proposals, I *am* ready for feedback on the various
> open issues sprinkled throughout the current text, especially
> concerning decisions regarding exactly which operations to include in
> the various ABCs, and also regarding the level of detail required in
> the PEP.
>
> --
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/john.reese%40gmail.com
>
"This PEP proposes a particular strategy for organizing these tests
known as Abstract Base Classes, or ABC. ABCs are simply Python classes
that are added into an object's inheritance tree to signal certain
features of that object to an external inspector. Tests are done using
isinstance(), and the presence of a particular ABC means that the test
has passed."
I'd like to see another few lines in the rationale section explaining
the intent of the concrete methods. For example, inheriting from
abc.Mapping would have a similar effect to inheriting from
UserDict.DictMixin -- by overriding it's few abstract methods you get
close to the full complement of dict's convenience methods. But from
the open issues and other discussion in this thread, I don't think the
intention is to provide full coverage of the convenience methods in
all of the builtin classes in their corresponding ABCs, but merely to
expand the number of methods you can assume given an ABC.
I'd like an explanation of exactly where the line is being drawn in
terms of what convenience methods ABCs will provide through concrete
methods.
More information about the Python-3000
mailing list