MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / __init__

Method __init__

example_code/item_124_example_06.py:23–24  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21
22class Counter:
23 def __init__(self) -> None:
24 self.value: int = 0 # Field / variable annotation
25
26 def add(self, offset: int) -> None:
27 value += offset # Oops: forgot "self."

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected