Add type hints

Open
#54 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
backend

Research direction

The issue names no cothread files or tests. Start by comparing cothread’s public API with the aioca example in aioca/types.py, especially the Protocol for AugmentedValue, then clarify whether the intended scope is Protocols or constrained TypeVars and Generics and define how typing coverage will be validated.

Written by the indexing model from the issue text.

Description

At the moment, cothread does not play nicely with type hinting in the rest of your code.

This could be done to a limited extent, as with aioca. For example, a Protocol is used here to make the list of additional attributes on an AugmentedValue clear.

Alternatively, this could be done more comprehensively using constrained TypeVars and Generics. Python typing is not perfect, so this may introduce problems.

Dominant language
C
Stars
13
Forks
11
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 DiamondLightSource/cothread

All issues in DiamondLightSource/cothread

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.