Research: Explore type-enforcement

Open
#885 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start by reviewing Python's typing module, mypy, the linked Google Python Style Guide guidance, and the listed migration posts. Compare available type-enforcement options and their tradeoffs, then document a recommendation for this project; done means the options and decision criteria are clearly recorded.

Written by the indexing model from the issue text.

Description

enhancement medium michael-review

We've started documenting the types of function parameters in our Python docstrings. If we're doing that, we might as well do it programmatically so that static tools can verify the types for us.

What are our options for type enforcement in Python?

There's the native typing module as well as mypy. Are there other options? What are the tradeoffs between the available options?

The Google Python Style Guide now has guidance about type checking, but we don't necessarily have to adopt their strategy, as they're working under different constraints:

https://google.github.io/styleguide/pyguide.html#221-type-annotated-code

Blog posts about migrating to mypy
Dominant language
Python
Stars
3.5k
Forks
291
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tiny-pilot/tinypilot

All issues in tiny-pilot/tinypilot

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.