MCPcopy Create free account
hub / github.com/ipython/traitlets / OrderTraits

Class OrderTraits

tests/test_traitlets.py:2403–2431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2401
2402
2403class OrderTraits(HasTraits):
2404 notified = Dict()
2405
2406 a = Unicode()
2407 b = Unicode()
2408 c = Unicode()
2409 d = Unicode()
2410 e = Unicode()
2411 f = Unicode()
2412 g = Unicode()
2413 h = Unicode()
2414 i = Unicode()
2415 j = Unicode()
2416 k = Unicode()
2417 l = Unicode() # noqa: E741
2418
2419 def _notify(self, name, old, new):
2420 """check the value of all traits when each trait change is triggered
2421
2422 This verifies that the values are not sensitive
2423 to dict ordering when loaded from kwargs
2424 """
2425 # check the value of the other traits
2426 # when a given trait change notification fires
2427 self.notified[name] = {c: getattr(self, c) for c in "abcdefghijkl"}
2428
2429 def __init__(self, **kwargs):
2430 self.on_trait_change(self._notify)
2431 super().__init__(**kwargs)
2432
2433
2434def test_notification_order():

Callers 1

test_notification_orderFunction · 0.85

Calls 2

DictClass · 0.90
UnicodeClass · 0.90

Tested by 1

test_notification_orderFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…