Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv16780
Modified Files:
bits.py
Log Message:
allow sequence assignments to [::n] in Bits.__setitem__
Index: bits.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/bits.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- bits.py 27 Apr 2003 07:35:26 -0000 1.11
+++ bits.py 27 Apr 2003 07:53:02 -0000 1.12
@@ -52,7 +52,13 @@
def __setitem__ (this, index, value):
if isinstance(index, SliceType):
start, stop, step = index.start, index.stop, index.step
- if start == None: start = len(this._contents)
+ if start == None:
+ if isinstance(value, int) or isinstance(value, long):
+ start = len(this._contents)
+ else:
+ for v in value:
+ this.__setitem__(index, v)
+ return
if stop != None or not step in (1, 2, 4):
raise 'Bad slice for Bits.__setitem__', index
if start > len(this._contents): raise IndexError, start
|