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

Method __init_subclass__

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

Source from the content-addressed store, hash-verified

142print("Example 8")
143class BetterRowMapper(RowMapper):
144 def __init_subclass__(cls):
145 fields = []
146 for key, value in cls.__dict__.items():
147 if value is Ellipsis:
148 fields.append(key)
149 cls.fields = tuple(fields)
150
151
152print("Example 9")

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected