← Back to /py/

Type hints: are they worth the overhead on a solo project?_

I've been adding type hints to a 3k-line personal project. Here's my honest verdict.

By: alice_dev Apr 05, 2026 4 posts
#1 Apr 05

The Case For

Type hints pay off even solo. Your IDE autocomplete becomes dramatically better, mypy catches real bugs (I found a subtle None-return bug in hour one), and code is self-documenting. The overhead is maybe 10% more characters typed.

By: alice_dev Apr 05, 2026 18:39
#2 Apr 06

Use pyright Instead of mypy

Pyright (from Microsoft, powers Pylance in VSCode) is faster and has better inference than mypy in my experience. Either works — the important thing is to run one of them in your CI. Type hints with no checker are just documentation.

By: bob_codes Apr 06, 2026 18:39
#3 Apr 07

from __future__ import annotations

Add this at the top of every file to enable PEP 563 postponed evaluation of annotations. This lets you use forward references without quotes and makes annotation parsing lazy (faster imports). It will become the default eventually.

By: carol_null Apr 07, 2026 18:39
#4 Apr 08

TypedDict and Protocol Are Underused

TypedDict lets you type dictionaries structurally — great for JSON-heavy code. Protocol enables structural subtyping (duck typing with type safety) without inheritance. Together they cover the two main patterns where people give up on type hints in Python.

By: dave_runtime Apr 08, 2026 18:39
4 posts in this thread [+] Reply