This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Install dependencies:
make installorpoetry install - Create virtual environment:
make venvorpython3 -m venv venv - Format code:
make formatorpoetry run black . && poetry run isort . - Lint code:
make lintorpoetry run flake8 . && poetry run mypy . - Type check:
make typecheckorpoetry run mypy . - Run all tests:
make testorpoetry run pytest tests/ - Run single test file:
make test-file FILE=tests/test_file.pyorpoetry run pytest tests/test_file.py -v - Run single test function:
make test-function FILE=tests/test_file.py::test_functionorpoetry run pytest tests/test_file.py::TestClass::test_method -v - Run tests in exercises:
cd exercises && poetry run pytest test_file.py
- Use Python 3.11+ features and syntax
- Follow PEP 8 style guidelines with Black (line-length=88) and isort
- Use strict type hints throughout (mypy with disallow_untyped_defs=true)
- Use snake_case for variables/functions, PascalCase for classes
- Organize imports: standard library, third-party, local
- Include docstrings for all modules, classes, and functions
- Use context managers for resource handling
- Raise specific exceptions with descriptive messages
- Validate input parameters with assertions or value checks
- Structure code using modules and packages appropriately
The repository includes a simple language implementation with lexer, parser, and evaluator supporting functional programming constructs and reflection capabilities.