Python

Virtualenv + run

bash
python -m venv .venv
source .venv/bin/activate
python main.py

Dataclass

python
from dataclasses import dataclass

@dataclass(frozen=True)
class User:
    id: str
    email: str

Typing + async

python
from typing import Any

async def fetch_json(url: str) -> dict[str, Any]:
    import aiohttp
    async with aiohttp.ClientSession() as s:
        async with s.get(url) as r:
            r.raise_for_status()
            return await r.json()