Astral released Ty (Beta) last month.
As a prototyper, I don't type check much - it slows me down. But the few apps I shipped to production had bugs type checking could have caught. Plus, LLMs don't get slowed by type checking.
So I decided to check if Ty can spot real bugs in real code.
Run
ty(Astral's new type checker) on a few popular Python packages' source code, list the errors Ty reports (most of which may be false positives), and identify at least a few that are genuine bugs, not false positives. Write sample code or test case to demonstrate the bug.Don't fool yourself into inventing false or borderline bugs. Find genuine bugs.
After 25 minutes, ChatGPT reported:
from tqdm.rich import tqdm
bar = tqdm(total=3)
bar.update(1)
# This crashes inside tqdm's rich integration
bar.reset(total=3)
... produces this error:
TypeError: Progress.reset() missing 1 required positional argument: 'task_id'
I verified this locally:
uv run --with tqdm python -c '
from tqdm.rich import tqdm
bar = tqdm(total=3)
bar.update(1)
bar.reset(total=3)'

Yes! Same error.
But is it really a bug?
self._task_id as the first argument to self._prog.reset(total=total) in tqdm/rich.pySo I bumped it up
This entire process of:
... took 30 min of my time and 30 min of computer time.
The hardest problem in computer science isn't P-vs-NP or cache invalidation. It's understanding why a human will click a green 'Merge' button.