File size: 268 Bytes
23e73f9
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from typing import Dict, Type
from .base_method import BaseMethod

METHOD_REGISTRY: Dict[str, Type[BaseMethod]] = {}

def register_method(name: str):
    def decorator(cls: Type[BaseMethod]):
        METHOD_REGISTRY[name] = cls
        return cls
    return decorator