Skip to content

Commit 374b365

Browse files
committed
docs: add modern type hints guidelines to development documentation
Add section documenting the project's preference for Python 3.9+ built-in generic types over typing module imports. This guides contributors to use modern typing conventions consistently across the codebase.
1 parent 5400f64 commit 374b365

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ Each strategy contains:
8888

8989
Uses Ruff (linting/formatting), basedpyright (type checking), pytest (testing), conventional commits, and Release Please automation.
9090

91+
**Modern Type Hints**: Use built-in types for Python 3.9+ instead of typing module equivalents:
92+
- Use `dict` instead of `Dict`
93+
- Use `list` instead of `List`
94+
- Use `tuple` instead of `Tuple`
95+
- Use `set` instead of `Set`
96+
- Use `str | None` instead of `Optional[str]`
97+
- Use `int | str` instead of `Union[int, str]`
98+
9199
## Project Structure
92100

93101
```
@@ -135,6 +143,6 @@ The `--strategy` flag accepts either built-in strategy names or paths to custom
135143

136144
Each strategy directory must contain:
137145
- `STRATEGY.md.jinja`: Strategy-specific guide
138-
- `GAMESTATE.md.jinja`: Game state representation
146+
- `GAMESTATE.md.jinja`: Game state representation
139147
- `MEMORY.md.jinja`: Response history tracking
140148
- `TOOLS.json`: Strategy-specific function definitions

0 commit comments

Comments
 (0)