execution order of trait observers
- 主要言語
- Python
- スター
- 653
- フォーク
- 217
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 2
説明
its not clear to me in what order the trait observers get executed and why?
can anyone shed light on this?
```py
class Test(tr.HasTraits):
a = tr.Bool(default_value=True)
b = tr.Bool(default_value=True)
c = tr.Bool(default_value=True)
@tr.observe("a")
def _a(self, on_change):
print(f"a = {self.a}")
@tr.observe("b")
def _b(self, on_change):
print(f"b = {self.b}")
@tr.observe("c")
def _c(self, on_change):
print(f"c = {self.c}")
def __init__(self, **kwargs):
super().__init__(**kwargs)
t1 = Test(a=False, b=False, c=False)
print("---")
t2 = Test(c=False, b=False, a=False)
# b = False
# c = False
# a = False
# ---
# b = False
# c = False
# a = False
```
many thanks
コントリビューションガイド
調査の方向性
Start with the Test example and its tr.observe handlers, then inspect how trait initialization processes the keyword arguments and dispatches observers. Done means documenting the actual execution-order rule and why both argument orders produce the shown output.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100