def __init__(self, parent, key):
        self.parent = parent
        self.key = key

        # Choose a human-readable name for this view.
        if isinstance(self.parent, RootView):
            self.name = ''
        else:
            self.name = self.parent.name
            if not isinstance(self.key, int):
                self.name += '.'
        if isinstance(self.key, int):
            self.name += u'#{0}'.format(self.key)
        elif isinstance(self.key, BASESTRING):
            if isinstance(self.key, bytes):
                self.name += self.key.decode('utf8')
            else:
                self.name += self.key
        else:
            self.name += repr(self.key)
Make a subview of a parent view for a given subscript key.
dataset/ETHPy150Open beetbox/beets/beets/util/confit.py/Subview.__init__