Re: Abstract class

2008-09-14 Thread Stephen Horne
On Sun, 14 Sep 2008 18:03:23 +0200, Mr.SpOOn <[EMAIL PROTECTED]> wrote: >I have to manage many elements of music such as notes, intervals, >scales, chords and so on. All these elements share properties and >behavior, so what I want to do is an abstract class "Note" and other >subclasses, for examp

Re: explain slice assignment to newb

2008-09-20 Thread Stephen Horne
On Sat, 20 Sep 2008 14:20:20 -0700 (PDT), Andrew <[EMAIL PROTECTED]> wrote: >please explain this behavior to a newb: > a = [1,2,3,4] b = ["a","b","c","d"] a[0:2] = b[0:2] The slice [0:2] represent positions 0 <= x < 2 Replaces the [1, 2] from [1, 2, 3, 4] with ['a', 'b'] Result: a