[Python-3000] Generic function PEP won't make it in time

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 26 03:07:13 CEST 2007


Paul Moore wrote:
> My point was that as far as I am aware,
> Guido's current position on ABCs is that they are, and will remain,
> optional - people like myself (and Greg, from the sound of it) who
> don't want to derive from ABCs will not be penalised by being excluded
> from anything in the Python core or the stdlib.

Maybe not in the core or stdlib, but it seems like
there will be cases where one *is* penalised for
not using the ABCs, if they get used the way the
PEP proposes.

 From the PEP, it seems there are two purposes for
these proposed ABCs:

1) To document what is meant when we say that something
is a "sequence", "mapping", etc.

This could be done simply by writing documentation. There
is no need for anything embodied in the language.

2) To mark a class for the purposes of introspection.

I thought we had generally agreed that this is an
anti-pattern in Python. If I want my object to
interoperate with someone else's code that tests for
the presence of some ABC, then I *am* forced to use
that ABC, even if it doesn't entirely suit my
purposes.

I'm -1 on including anything in the language, stdlib
or docs that appears to officially sanction type
testing as a normal style of programming.

--
Greg


More information about the Python-3000 mailing list