Skip to content

Instantly share code, notes, and snippets.

@jacob414
Created May 17, 2020 20:54
Show Gist options
  • Save jacob414/3523f99964f58c106e37e3f6b26a1de9 to your computer and use it in GitHub Desktop.
Save jacob414/3523f99964f58c106e37e3f6b26a1de9 to your computer and use it in GitHub Desktop.
Tracebacks?
from dataclasses import dataclass
from typing import TypeVar, Generic, Any, Iterable, List
T = TypeVar("T")
# See https://github.com/python/mypy/issues/5485
@dataclass
class Box(Generic[T]):
inner: T
@property
def unboxed(self) -> T:
return self.inner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment