Beispiel #1
0
        public virtual object __getslice__(int start, int stop)
        {
            Slice.FixSliceArguments(_data.Length, ref start, ref stop);

            if (start == 0 && stop == _data.Length &&
                this.GetType() == typeof(PythonTuple))
            {
                return(this);
            }
            return(MakeTuple(ArrayOps.GetSlice(_data, start, stop)));
        }
Beispiel #2
0
        public virtual object this[[NotNone] Slice slice] {
            get {
                slice.Indices(_data.Length, out int start, out int stop, out int step);

                if (start == 0 && stop == _data.Length && step == 1 &&
                    this.GetType() == typeof(PythonTuple))
                {
                    return(this);
                }
                return(MakeTuple(ArrayOps.GetSlice(_data, start, stop, step)));
            }
        }
Beispiel #3
0
        public virtual object GetSlice(int start, int stop)
        {
            if (start < 0)
            {
                start = 0;
            }
            if (stop > GetLength())
            {
                stop = GetLength();
            }

            return(Make(ArrayOps.GetSlice(data, data.Length, new Slice(start, stop))));
        }
Beispiel #4
0
 public object this[Slice slice] {
     get {
         return(Make(ArrayOps.GetSlice(data, data.Length, slice)));
     }
 }
Beispiel #5
0
 public virtual object this[Slice slice] {
     get {
         return(MakeTuple(ArrayOps.GetSlice(_data, slice)));
     }
 }
Beispiel #6
0
        public virtual object __getslice__(int start, int stop)
        {
            Slice.FixSliceArguments(_data.Length, ref start, ref stop);

            return(MakeTuple(ArrayOps.GetSlice(_data, start, stop)));
        }