def set(self, value): """ Sets the contained value to the given one. """ assert (not is_sequence_like(value)) and (not is_dict_like(value)), 'the value must be an atomic primitive' token_index = self._value_token_index() self._tokens[token_index] = py2toml.create_primitive_token(value)
def test_is_sequence_like(): assert is_sequence_like([1, 3, 4]) assert not is_sequence_like(42)