Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
A : array (42 .. 47) of Integer;
integer, dimension(42:47) :: a
var
a: array[42..47] of integer;
class List(list):
def __init__(self, offset, *args):
super().__init__(*args)
self.offset = offset
def offset(method):
def wrapped(self, index, *args):
index -= self.offset
return method(self, index, *args)
return wrapped
@offset
def __setitem__(self, key, value):
super().__setitem__(key, value)
@offset
def __getitem__(self, item):
return super().__getitem__(item)
a = List(42, 'abcdef')