ipython / ipython/traitlets

`TraitType.make_dynamic_default` is not mentioned in the docs

オープン
#787 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
653
フォーク
217
平均マージ
2日 21時間
マージ済み PR(30日)
2

説明

Per the title, there is no mention of `make_dynamic_default` for custom `TraitTypes` in the [docs right now](https://traitlets.readthedocs.io/en/stable/defining_traits.html). 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`](https://github.com/ipython/traitlets/blob/c17eb89e8201e06791e5439585d34d05c28aefff/traitlets/traitlets.py#L616), but this should be better highlighted in the public-facing documentation.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。