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 abc import ABC, abstractmethod | |
from functools import reduce | |
from typing import Tuple, TypeVar, Union, Iterable, Mapping | |
TInstance = TypeVar("TInstance") | |
class AbstractFactory(Iterable[TInstance], ABC): | |
pass | |
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 functools import partial | |
class MemoizedMethod: | |
def __init__(self, func): | |
self.func = func | |
def __get__(self, obj, objtype=None): | |
if obj is None: | |
return self.func |
NewerOlder