Skip to content

Commit

Permalink
docs: Add ADR about typing
Browse files Browse the repository at this point in the history
  • Loading branch information
augustebaum committed Jan 14, 2025
1 parent 765e8eb commit cbd9291
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/design/0003-use-union-rather-than-pipe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
date: 2025-01-14
decision-makers: ["@augustebaum", "@thomass-dev"]
---

# Use `typing.Union` rather than `|` in type hints

## Context and Problem Statement

This ADR originates from a discussion in [this PR comment](https://github.com/probabl-ai/skore/pull/1084#discussion_r1914402895).

Writing a union type using `|` is [only available from Python 3.10](https://docs.python.org/3.12/library/typing.html#typing.Union), while we currently intend to support Python 3.9.
Even though we do not formally check type-hints using automatic tools like `mypy`, we still strive for consistency for style issues of this kind.

## Decision Outcome

Use `typing.Union` rather than `|` in type hints.

0 comments on commit cbd9291

Please sign in to comment.