An open API service indexing awesome lists of open source software.

https://github.com/codeforreal1/python-typechecking

Type Checking in Python with ty
https://github.com/codeforreal1/python-typechecking

Last synced: 12 months ago
JSON representation

Type Checking in Python with ty

Awesome Lists containing this project

README

          

# Type Checking in Python with [ty](https://github.com/astral-sh/ty)

Run:

```
uv run ./src/.py
```

#### Basic

| Description | Syntax |
| ------------- | ------- |
| String | `str` |
| Integer | `int` |
| Float/Decimal | `float` |
| Boolean | `bool` |
| Bytes | `bytes` |
| Void/Null | `None` |

#### Collection

| Description | Syntax |
| ----------- | -------------------- |
| List | `List[T]` |
| Dictionary | `Dict[K, V]` |
| Set | `Set[T]` |
| Tuple | `Tuple[T1, T2, ...]` |
| Iterable | `Iterable[T]` |
| Sequence | `Sequence[T]` |

#### Other

| Description | Syntax |
| ----------- | -------------------- |
| Literal | `Literal[T]` |
| Union | `Union[T1, T2, ...]` |
| Optional | `Optional[T]` |
| TypedDict | `TypedDict` |
| Self | `Self` |
| Final | `Final` |
| Any | `Any` |