A view for Python list slices
If you are dealing with number lists, then array.array has a compact memory representation and implements the buffer protocol which allows memoryview’s to be created, which directly support views like you are creating.

For lists which can hold other things (tuples, dictionaries, lambdas, ...), Python has no built in support, and your view class can be appropriate.



PEP8 guidelines

Your class name should begin with a capital letter.  I’d suggest ListView as an option.  I don’t know what the ‘y’ is intended to mean.

There should be one space after every comma.  There shouldn’t be any spaces between a variable name and the [ character (b = a[1:3]).

Private members (self.begin, etc) should begin with an underscore (self._begin, etc).

Use a pylint, pyflakes, ... to ensure PEP8 compliance. 



You could implement __repr__ in terms of __str__:

    def __repr__(self):
        return str(self)




Extension: Your list view could support a view slice with a step size other than 1.



You don’t protect against indexing beyond the length of your view. i &gt;= self.len.