[Python-3000] Breakthrough in thinking about ABCs (PEPs 3119 and 3141) (original) (raw)

Jim Jewett jimjjewett at gmail.com
Tue May 1 16:52:18 CEST 2007


On 4/30/07, Guido van Rossum <guido at python.org> wrote:

The idea of overloading isinstance and issubclass is running into some resistance. I still like it, but if there is overwhelming discomfort, we can change it so that instead of writing isinstance(x, C) or issubclass(D, C) (where C overloads these operations), you'd have to write something like C.hasinstance(x) or C.hassubclass(D), where hasinstance and hassubclass are defined by some ABC metaclass. I'd still like to have the spec for hasinstance and hassubclass in the core language, so that different 3rd party frameworks don't need to invent different ways of spelling this inquiry.

Would it help to get away from class/instance entirely, and call them something like isexample? (Though class vs instance gets harder then. areexamples?)

(And yes, I think it would, but no, I don't yet have the code written out to explain.)

-jJ



More information about the Python-3000 mailing list