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

Method class_get_help

traitlets/config/configurable.py:251–265  ·  view source on GitHub ↗

Get the help string for this class in ReST format. If `inst` is given, its current trait values will be used in place of class defaults.

(cls, inst: HasTraits | None = None)

Source from the content-addressed store, hash-verified

249
250 @classmethod
251 def class_get_help(cls, inst: HasTraits | None = None) -> str:
252 """Get the help string for this class in ReST format.
253
254 If `inst` is given, its current trait values will be used in place of
255 class defaults.
256 """
257 assert inst is None or isinstance(inst, cls)
258 final_help = []
259 base_classes = ", ".join(p.__name__ for p in cls.__bases__)
260 final_help.append(f"{cls.__name__}({base_classes}) options")
261 final_help.append(len(final_help[0]) * "-")
262 for _, v in sorted(cls.class_traits(config=True).items()):
263 help = cls.class_get_trait_help(v, inst)
264 final_help.append(help)
265 return "\n".join(final_help)
266
267 @classmethod
268 def class_get_trait_help(

Callers 6

test_helpMethod · 0.80
test_help_instMethod · 0.80
class_print_helpMethod · 0.80
emit_helpMethod · 0.80

Calls 3

appendMethod · 0.80
class_traitsMethod · 0.80
class_get_trait_helpMethod · 0.80

Tested by 4

test_helpMethod · 0.64
test_help_instMethod · 0.64