FEEDBACK WANTED: Type/class unification

Paul Moore paul.moore at uk.origin-it.com
Mon Aug 20 05:00:37 EDT 2001


On Sat, 28 Jul 2001 17:35:44 +0200, Guido van Rossum <guido at python.org> wrote:

>When I released Python 2.2a1, the type/class unification feature was
>announced as TENTATIVE.  It's been a while now (feels like a year,
>although I realize it's only been 10 days :), and I would like to see
>some feedback on this.

I was thinking about this last night, and one point struck me...

I have a C extension type, which was written back in the days of Python 1.4,
and which has worked unchanged since then. With the advent of type/class
unification in Python 2.2, I know of no reason why this would change. However,
I can imagine that users of my type would expect to be able to subclass my
type, once 2.2 arrives. (I have no idea why they might *want* to do such a
thing, but it's a truism that users find far stranger reasons for doing things
than developers ever imagined...)

So I looked through PEP 252 looking for a simple summary of how to add
"subclassability" to an existing C type. I could find nothing.

I'm assuming that I have to do *something*. If this assumption is wrong, I'd
like it if the PEP made this (good news) clearer up front. Ideally, the
changes required should be fairly boilerplate style code, which can be written
in such a way that compatibility with earlier versions of Python (maybe even
back to 1.4!!!) is not affected.

Have I missed anything here?

Paul.




More information about the Python-list mailing list