public object this[int index] {
     get {
         index = ValidateIndex(index);
         return(_buffer.GetItem(index + _start));
     }
     set {
         if (_buffer.ReadOnly)
         {
             throw PythonOps.TypeError("cannot modify read-only memory");
         }
         ValidateIndex(index);
         _buffer.SetItem(index + _start, value);
     }
 }
Beispiel #2
0
 public object this[int index] {
     get {
         CheckBuffer();
         index = PythonOps.FixIndex(index, __len__());
         return(_buffer.GetItem(index + _start));
     }
     set {
         CheckBuffer();
         if (_buffer.ReadOnly)
         {
             throw PythonOps.TypeError("cannot modify read-only memory");
         }
         index = PythonOps.FixIndex(index, __len__());
         _buffer.SetItem(index + _start, value);
     }
 }