
With the code below i get a RuntimeError(‘Set changed size during iteration’,) message when clicking on the buttons, but the callback is doing exactly what it;s meant to do (adds buttons) and the added buttons work well too. It seems the set changed size error has no effect at all, or does it? Not sure if I should be concerned by it
I use python 3.7 and bokeh 1.1.0
from bokeh.io import curdoc
from bokeh.models import Button
from bokeh.layouts import widgetbox
def add_button():
box = curdoc().select_one({“name”:“test”})
n = len(box.children)
button = Button(label=‘test{}’.format(n))
button.on_click(add_button)
box.children += [button]
button = Button(label=‘test’)
button.on_click(add_button)
box = widgetbox([button],name=‘test’)
curdoc().add_root(box)
``

