[ python-Feature Requests-721061 ] Add copyrange method to array.

SourceForge.net noreply at sourceforge.net
Sat Mar 13 17:46:36 EST 2004


Feature Requests item #721061, was opened at 2003-04-14 22:41
Message generated for change (Comment added) made by nyamatongwe
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=721061&group_id=5470

Category: Extension Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Neil Hodgson (nyamatongwe)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add copyrange method to array.

Initial Comment:
The split buffer data structure commonly used in text 
editors to efficiently manipulate text and data attached 
to that text can be implemented using the Python array 
type with the addition of a way to rapidly copy data 
within arrays. There may be other situations in which 
rapidly copying blocks within an array is useful.

-- Neil Hodgson

----------------------------------------------------------------------

>Comment By: Neil Hodgson (nyamatongwe)
Date: 2004-03-14 09:46

Message:
Logged In: YES 
user_id=12579

If you are asking how the copyrange differs from a sliced
copy like
>>> import array
>>> a = array.array("c", "0123456789")
>>> a
array('c', '0123456789')
>>> a[5:8] = a[0:3]
>>> a
array('c', '0123401289')

   There is an extra object creation and copy for the
temporary slice. I think the actual copy between slices of
the same type is fast. Possibly the original patch was lost
so it can be found at
http://scintilla.sourceforge.net/arraycopyrange.diff
   I didn't chase this much before as it may be better for
me to produce a 'text' class that combines more features
into an efficient mutable document type.

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2004-03-14 08:44

Message:
Logged In: YES 
user_id=80475

How does this differ from slice semantics?

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-05-22 17:44

Message:
Logged In: YES 
user_id=80475

Moving to feature requests.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=721061&group_id=5470



More information about the Python-bugs-list mailing list