You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per the title, there is no mention of make_dynamic_default for custom TraitTypes in the docs right now. The current example uses a tuple with two immutable elements, so it's technically safe, but it is at best incomplete (for people who want a mutable default) and at worst misleading (for people who thoughtlessly use a list or other mutable type instead of tuple, or put something mutable inside such a tuple).
The code itself is very nicely written, so once I decided it ought to be possible to safely have mutable defaults for children of TraitTypes I had no trouble finding the search for make_dynamic_default, but this should be better highlighted in the public-facing documentation.
The text was updated successfully, but these errors were encountered:
Per the title, there is no mention of
make_dynamic_default
for customTraitTypes
in the docs right now. The current example uses a tuple with two immutable elements, so it's technically safe, but it is at best incomplete (for people who want a mutable default) and at worst misleading (for people who thoughtlessly use a list or other mutable type instead of tuple, or put something mutable inside such a tuple).The code itself is very nicely written, so once I decided it ought to be possible to safely have mutable defaults for children of
TraitTypes
I had no trouble finding the search formake_dynamic_default
, but this should be better highlighted in the public-facing documentation.The text was updated successfully, but these errors were encountered: