[Python-Dev] __contains__ hook
Guido van Rossum
guido@python.org
Thu, 03 Feb 2000 13:54:13 -0500
> > Because if we add a slot to the as_sequence struct, old extensions
> > that haven't been recompiled will appear to have garbage in that slot
> > (because they don't actually have it). When we use a spare slot in
> > the main type struct, that problem doesn't exist; but the as_sequence
> > struct and friends don't have spares.
>
> Good point. I still think a spare slot should be used so sets don't
> have to look like sequences.
But they won't have to -- all the other pointers in the as_sequence
struct can be NULL. (This used to be not the case, but I've finally
given in and added NULL tests everywhere -- it was a recurring
complaint from extension writers.)
--Guido van Rossum (home page: http://www.python.org/~guido/)