use dataclass for RegexCallback

This commit is contained in:
Denis-Cosmin Nutiu 2023-06-05 11:52:50 +03:00
parent 1d882bc72b
commit f18c95cdf7

View file

@ -1,9 +1,14 @@
import dataclasses
import re
from collections import namedtuple
from typing import Callable
from app import utils
RegexCallback = namedtuple("RegexCallback", ["callback", "name"])
@dataclasses.dataclass
class RegexCallback:
callback: Callable[[re.Match], str]
name: str
class RegexHeuristics: