| 20 | # Check types in this file with: python3 -m mypy <path> |
| 21 | |
| 22 | class 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." |
| 28 | |
| 29 | def get(self) -> int: |
| 30 | self.value # Oops: forgot "return" |
| 31 | |
| 32 | counter = Counter() |
| 33 | counter.add(5) |
no outgoing calls
no test coverage detected