File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99import sys
1010from argparse import ArgumentParser
11- from typing import TYPE_CHECKING , TextIO
11+ from typing import TYPE_CHECKING , TextIO , TypeVar
12+
13+ from translation_finder .discovery .base import BaseDiscovery
1214
1315from .finder import Finder
1416
1517if TYPE_CHECKING :
1618 from pathlib import PurePath
1719
18- from translation_finder .discovery .base import BaseDiscovery
1920 from translation_finder .discovery .result import DiscoveryResult
2021
2122 from .finder import PathMockType
2223
2324BACKENDS : list [type [BaseDiscovery ]] = []
2425
2526
26- def register_discovery (cls : type [BaseDiscovery ]) -> type [BaseDiscovery ]:
27+ DiscoveryT = TypeVar ("DiscoveryT" , bound = type [BaseDiscovery ])
28+
29+
30+ def register_discovery (cls : DiscoveryT ) -> DiscoveryT :
2731 """Register a discovery class."""
2832 BACKENDS .append (cls )
2933 return cls
You can’t perform that action at this time.
0 commit comments