def append(self, key, _item):  # type: (Union[Key, str], Any) -> Table
        """
        Appends a (key, item) to the table.
        """
        if not isinstance(_item, Item):
            _item = item(_item)

        self._value.append(key, _item)

        if isinstance(key, Key):
            key = key.key

        if key is not None:
            super(Table, self).__setitem__(key, _item)

        m = re.match("(?s)^[^ ]*([ ]+).*$", self._trivia.indent)
        if not m:
            return self

        indent = m.group(1)

        if not isinstance(_item, Whitespace):
            m = re.match("(?s)^([^ ]*)(.*)$", _item.trivia.indent)
            if not m:
                _item.trivia.indent = indent
            else:
                _item.trivia.indent = m.group(1) + indent + m.group(2)

        return self
def append ( self , key , _item ) : if not isinstance ( _item , Item ) : _item = item ( _item ) self . _value . append ( key , _item ) if isinstance ( key , Key ) : key = key . key if key is not None : super ( Table , self ) . __setitem__ ( key , _item ) m = re . match ( "(?s)^[^ ]*([ ]+).*$" , self . _trivia . indent ) if not m : return self indent = m . group ( 1 ) if not isinstance ( _item , Whitespace ) : m = re . match ( "(?s)^([^ ]*)(.*)$" , _item . trivia . indent ) if not m : _item . trivia . indent = indent else : _item . trivia . indent = m . group ( 1 ) + indent + m . group ( 2 ) return self
Appends a (key, item) to the table.