_____ __ _
| __ \ / _| |
| |__) | _ _ __ ___ | |_| |_ _
| ___/ | | | '__/ _ \| _| | | | |
| | | |_| | | | __/| | | | |_| |
|_| \__, |_| \___||_| |_|\__, |
__/ | __/ |
|___/ |___/
~~~ PyCon US 2026 Type Challenge ~~~
May 13–19, 2026 · Long Beach, CA
Hello and welcome to the Pyrefly Type Challenge! Fix type bugs, configure Pyrefly, and write some type-safe code. Complete all three parts and show your work to Meta booth staff for a swag reward!
| Part | Task |
|---|---|
| 1 | Install & configure Pyrefly |
| 2 | Fix every type error in challenge.py |
| 3 | Write 20–50 lines of your own type-safe code |
# 1. Clone the repo
git clone https://github.com/migeed-z/pyrefly-type-challenge.git
cd pyrefly-type-challenge
# 2. Install pyrefly (use any Python environment you prefer)
pip install pyrefly
# 3. Try running pyrefly on the challenge file
pyrefly check challenge.pyNow create a pyrefly.toml configuration file. Some bugs in challenge.py
only show up when you enable error checks that Pyrefly doesn't turn on by
default. Check the pyrefly docs
to learn more.
Open challenge.py and fix every type error. The file has a mix of bugs:
- Some that Pyrefly catches by default
- Others that only appear once your
pyrefly.tomlis configured correctly
Some fixes only need annotation changes, others require fixing the code itself — you can either rewrite the code or use error suppressions.
The rules:
- No
Any— remove all uses of it pyrefly check challenge.pymust pass with zero errors- Don't delete functions — fix them!
Hint: there are 3 error kinds disabled by default that enable stricter checking for return types, parameter types, and decorators. And remember the "no
Any" rule — there's a config setting for that too. Check the[errors]section in the configuration docs to find them.
At the bottom of challenge.py there's a stub function called score_quests().
Fill it in with 20–50 lines of type-safe code. No Any allowed!
Read the docstring for what to implement, then get creative with the scoring logic!
Once you're done, show your work to Meta booth staff to claim a reward (while supplies last). They'll want to see:
- Your
pyrefly.tomlsetup - A clean
pyrefly check challenge.pywith zero errors - A quick walk-through of your
score_quests()solution
Want your AI coding assistant to use Pyrefly automatically? Set up a rules file so your agent type-checks with Pyrefly out of the box.
Claude Code — add a CLAUDE.md file
# Type Checking
Use pyrefly for type checking Python files:
- Run `pyrefly check <file>` to check for type errors
- Fix all type errors before committing
- Never use `Any` — use proper type annotationsGitHub Copilot — add .github/copilot-instructions.md
Use pyrefly for Python type checking. Run `pyrefly check` on all Python files
before suggesting changes. Ensure code is fully annotated with no use of Any.Cursor — add a .cursor/rules file
Use pyrefly for Python type checking. Run `pyrefly check` on all Python files.
Ensure code is fully annotated with no use of Any.This is optional — but it's a great habit to start!
Pyrefly is a fast type checker and language server for Python, built in Rust. It's designed to be lightning-fast, easy to configure, and a joy to use.
Happy typing!
~ The Pyrefly Team at Meta ~