Skip to content

Commit 3f2c5af

Browse files
committed
Add note on mutable types and traitlets
1 parent 3a2202c commit 3f2c5af

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/source/examples/Widget Custom.ipynb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,13 @@
280280
"cell_type": "markdown",
281281
"metadata": {},
282282
"source": [
283-
"Traitlets is an IPython library for defining type-safe properties on configurable objects. For this tutorial you do not need to worry about the *configurable* piece of the traitlets machinery. The `sync=True` keyword argument tells the widget framework to handle synchronizing that value to the browser. Without `sync=True`, attributes of the widget won't be synchronized with the front-end."
283+
"Traitlets is an IPython library for defining type-safe properties on configurable objects. For this tutorial you do not need to worry about the *configurable* piece of the traitlets machinery. The `sync=True` keyword argument tells the widget framework to handle synchronizing that value to the browser. Without `sync=True`, attributes of the widget won't be synchronized with the front-end.\n",
284+
"\n",
285+
"<div class=\"alert alert-info\">\n",
286+
"Syncing mutable types\n",
287+
" \n",
288+
"Please keep in mind that mutable types will not necessarily be synced when they are modified. For example appending an element to a `list` will not cause the changes to sync. Instead a new list must be created and assigned to the trait for the changes to be synced.\n",
289+
"</div>"
284290
]
285291
},
286292
{
@@ -749,7 +755,7 @@
749755
"name": "python",
750756
"nbconvert_exporter": "python",
751757
"pygments_lexer": "ipython3",
752-
"version": "3.8.1"
758+
"version": "3.9.1"
753759
}
754760
},
755761
"nbformat": 4,

0 commit comments

Comments
 (0)