MCPcopy Index your code
hub / github.com/bslatkin/effectivepython / __init_subclass__

Method __init_subclass__

example_code/item_065.py:273–278  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

271print("Example 17")
272class Workflow:
273 def __init_subclass__(cls):
274 steps = []
275 for key, value in cls.__dict__.items():
276 if callable(value) and hasattr(value, "_is_step"):
277 steps.append(key)
278 cls.steps = tuple(steps)
279
280
281 print("Example 18")

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected