[Python-Dev] Re: List slice assignment and custom sequences

Michael Hudson mwh@python.net
Tue, 5 Nov 2002 17:50:48 +0000 (GMT)


On Tue, 5 Nov 2002, Ronald Oussoren wrote:

> 
> On Tuesday, Nov 5, 2002, at 15:03 Europe/Amsterdam, Michael Hudson 
> wrote:
> 
> > Ronald Oussoren <oussoren@cistron.nl> writes:
> >
> >> No, I want to replace part of a sequence by another sequence. I don't
> >> understand _why_ the RHS must be a list if the LHS is one.
> >
> > Because Objects/listobject.c:list_ass_slice pokes directly into the
> > object passed on the RHS.
> >
> > A patch to change this would have some chance of getting accepted;
> > wouldn't like to guess what, but I'd hazard non-zero.
> I sure hope so. I've posted a bug+patch at SF for a related problem: 
> With the introduction of new-style classes 'isinstance(obj, list)' no 
> longer guarantees that you can savely poke in the RHS instead of using 
> the __getitem__ accessor function.

Hmm, that's something (slightly) else.

I wonder if PySequence_FAST should use PyList_CheckExact and not 
PyList_Chec?  Guido?

Cheers,
M.