open-telemetry / open-telemetry/opentelemetry-python

Update typing style

Open
#4,457 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Following https://github.com/open-telemetry/opentelemetry-python/pull/4455 some of the codebase now uses from __future__ import annotations and the more modern type hinting of:

  • | None rather than Optional
  • | rather than Union
  • dict, list, tuplerather thantyping.Dict, typing.List, ``typing.Tuple

For consistency it would be better to move to the newer typing style across the whole codebase.

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.

Research direction

Start by reviewing pull request 4455 and the existing Python codebase to identify typing patterns that still use Optional, Union, or typing collection types. Update the remaining code for consistency with the newer style, including future annotations where needed, and verify that the whole codebase uses the intended conventions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Refactor
Difficulty
4/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.