Notice that helper attributes are passed as keyword arguments to the helper. In some cases, however, attribute names include special characters that are not allowed in Python identifiers (e.g., hyphens) and therefore cannot be used as keyword argument names. For example:
DIV('text', _data-role='collapsible')will not work because "_data-role" includes a hyphen, which will produce a Python syntax error.
In such cases, you can instead pass the attributes as a dictionary and make use of Python's
**function arguments notation, which map a dictionary of (key:value) pairs into a set of keyword arguments:>>> print DIV('text', **{'_data-role': 'collapsible'})<div data-role="collapsible">text</div>
form.element('input[id=what3]').update(
data={'content':'My text', 'toggle':'popover', 'original-title':'My title'}, _title='')form.element('input[id=what3]')['data'].update(newattribute='newvalue')