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

Class MyContainer

tests/test_traitlets.py:2766–2774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2764
2765 # observe with names=custom container with iter, contains
2766 class MyContainer:
2767 def __init__(self, container):
2768 self.container = container
2769
2770 def __iter__(self):
2771 return iter(self.container)
2772
2773 def __contains__(self, key):
2774 return key in self.container
2775
2776 c.observe(record, names=MyContainer({"i", "s"}))
2777 c.i = 10

Callers 1

test_observe_iterablesFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_observe_iterablesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…