use dataclass for RegexCallback
This commit is contained in:
parent
1d882bc72b
commit
f18c95cdf7
1 changed files with 7 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue