[Patches] [ python-Patches-633870 ] allow any seq assignment to a list slice
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 05 Nov 2002 08:51:46 -0800
Patches item #633870, was opened at 2002-11-05 15:59
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=633870&group_id=5470
Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Alex Martelli (aleax)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: allow any seq assignment to a list slice
Initial Comment:
as suggested by Michael Hudson in his comp.lang.python
post of Tue, 5 Nov 2002 14:03:46 GMT, Subject "Re: List
slice assignment and custom sequences", message id
<m2k7jsm7u7.fsf@python.net> . The patch affects
Objects/listobject.c: with no performance impact when the
RHS of an assignment to a list slice is a list, the patch also
allows the RHS to be any other sequence object acceptable
to PySequence_Fast -- just like such general sequences are
acceptable today e.g. as arguments to the extend method,
so the patch makes them acceptable as RHS in assignment
to list slices.
----------------------------------------------------------------------
>Comment By: Michael Hudson (mwh)
Date: 2002-11-05 16:51
Message:
Logged In: YES
user_id=6656
I wonder if you'd get much performance hit from just using
PySequence_FAST the whole time? All that does for a list
after all is Py_INCREF it (I hope you still have whatever
test harness you used to make your claims in the description).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=633870&group_id=5470