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

Class Bar

examples/myapp.py:73–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73class Bar(Configurable):
74 enabled = Bool(True, help="Enable bar.").tag(config=True)
75 mylist = List([1, 2, 3], help="Just a list.").tag(config=True)
76
77 def describe(self):
78 print("I am Bar with:")
79 print(" enabled = ", self.enabled)
80 print(" mylist = ", self.mylist)
81 self.subconf.describe()
82
83 def __init__(self, **kwargs):
84 super().__init__(**kwargs)
85 # here we do not use parent=self, so configuration in the form
86 # c.Bar.SubConfigurable.subvalue=1 will not work. Only
87 # c.SubConfigurable.subvalue=1 will work and affect all instances of
88 # SubConfigurable
89 self.subconf = SubConfigurable(config=self.config)
90
91
92class MyApp(Application):

Callers 1

init_barMethod · 0.70

Calls 3

BoolClass · 0.90
ListClass · 0.90
tagMethod · 0.80

Tested by

no test coverage detected