Advanced notes on widget behavior
Widgets are magical and often work how you want. But they can have surprising behavior in some situations. Here is a high-level, abstract description of widget behavior, including some common edge-cases:
If you call a widget function before the widget state exists, the widget state defaults to a value. This value depends on the widget and its arguments.
A widget function call returns the current widget state value. The return value is a simple Python type, and the exact type depends on the widget and its arguments.
Widget states depend on a particular session (browser connection). The actions of one user do not affect the widgets of any other user.
A widget's identity depends on the arguments passed to the widget function. If those change, the call will create a new widget (with a default value, per 1).
