Created
December 13, 2020 19:50
-
-
Save gidgid/351773a00f79dfb7d1e57a84e5054172 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
from typing import Any, Generic, TypeVar | |
T = TypeVar("T") | |
class Option(Generic[T]): | |
pass | |
@dataclass | |
class Some(Option[T]): | |
value: T | |
@dataclass | |
class Nothing(Option[Any]): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment