[Python-Dev] Re: Class/type dichotomy thoughts
Mon, 6 Nov 2000 02:35:29 -0800
On Mon, Nov 06, 2000 at 06:02:51PM +0100, M.-A. Lemburg wrote:
> Neil Schemenauer wrote:
> > Behavior should be based solely on the type structure. Extension
> > types would then be able to behave exactly like any other builtin
> > type. Your coercion proposal and David's rich comparisions both
> > remove some of this special casing based on type.
> Even though this could remove some of the problems, it doesn't
> help much with a common use of Py<Type>_Check(): that of
> using fast access macros and native Py<Type>_*() APIs once an
> object has been classified as being of a certain type.
> This usually improves performance.
Can you clarify what you mean by "it doesn't help much"? Do you
mean that extension types will not be able to perform as well as
types that get special treatment by the interpreter? I think the
major problem that extension types _cannot_ behave the same as
the builtin types.
> By changing the simple address compare to a type handle
> system, we might be able to add some more flexibility to
> the system while keeping b/w compatibility.
I don't see what this buys us. The Python interpreter shouldn't
care about which type object it is dealing with. Can you give an
example of where you think this would be useful?