Skip to content

Instantly share code, notes, and snippets.

View k98kurz's full-sized avatar

Jon Tyler k98kurz

View GitHub Profile
@k98kurz
k98kurz / result.py
Last active January 27, 2026 17:56
result.py: try_catch, Result type, and a pipe function
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Callable, Generic, TypeVar
T = TypeVar('T')
U = TypeVar('U')
@dataclass
class Ok(Generic[T]):