[Python-Dev] A small step to removing the type/class split

Thomas Wouters thomas@xs4all.net
Thu, 26 Oct 2000 12:21:05 +0200


On Wed, Oct 25, 2000 at 02:14:52PM +1300, Greg Ewing wrote:
> Neil Schemenauer <nas@arctrix.com>:

> > Those PyInstance_Check() calls should really go away. Instead, the
> > type should be responsible for providing different behavior.

> Yes, that's the crux of the problem, I think.

> Another place where this is a nuisance is where it
> assumes that if x has any tp_as_sequence slots and y
> has any tp_as_number slots, then x*y is a sequence
> replication operation.

This is screwed in more than one way. The logic of which 'type' operation
has precedence isn't even internally consistent. The case of 'x*y' and 'x+y'
check the tp_as_number and tp_as_sequence slots in a *different order*, so
'x*y' can end up a number where 'x+y' ends up a sequence. (Or the other way
'round, I forget. I'm also struggling to catch up on my mail since Apachecon
had little to no connectivity, so I don't feel like checking :)

Brainwashed-into-Apache-2.0-forever-ly y'rs,
-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!