Created
May 17, 2020 20:54
-
-
Save jacob414/3523f99964f58c106e37e3f6b26a1de9 to your computer and use it in GitHub Desktop.
Tracebacks?
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
import kind |
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 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