Skip to content

Commit d1238de

Browse files
committed
feedback addressed
1 parent ec078b8 commit d1238de

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
titlecase.CallbackProtocol
2-
titlecase.Pattern
1+
# typing the tests would present a requiremnt of effort with zero gain for the end user
32
titlecase.tests

stubs/titlecase/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version = "2.4.*"
22
upstream-repository = "https://github.com/ppannuto/python-titlecase"
3-
optional-dependencies = ["types-regex"]
3+
dependencies = ["types-regex"]
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import logging
22
import re
3-
from typing import Final, Protocol, TypeAlias, overload
3+
from typing import Final, Protocol, TypeAlias, overload, type_check_only
44
from typing_extensions import LiteralString
55

66
import regex
77

8-
Pattern: TypeAlias = re.Pattern[str] | regex.Pattern[str]
8+
_Pattern: TypeAlias = re.Pattern[str] | regex.Pattern[str]
99

1010
__all__ = ["titlecase"]
1111
__version__: Final[str]
@@ -16,20 +16,21 @@ REGEX_AVAILABLE: Final[bool]
1616
SMALL: Final[str]
1717
PUNCT: Final[str]
1818

19-
SMALL_WORDS: Pattern
20-
SMALL_FIRST: Pattern
21-
SMALL_LAST: Pattern
22-
SUBPHRASE: Pattern
23-
24-
MAC_MC: Final[Pattern]
25-
MR_MRS_MS_DR: Final[Pattern]
26-
INLINE_PERIOD: Final[Pattern]
27-
UC_ELSEWHERE: Final[Pattern]
28-
CAPFIRST: Final[Pattern]
29-
APOS_SECOND: Final[Pattern]
30-
UC_INITIALS: Final[Pattern]
31-
32-
class CallbackProtocol(Protocol):
19+
SMALL_WORDS: _Pattern
20+
SMALL_FIRST: _Pattern
21+
SMALL_LAST: _Pattern
22+
SUBPHRASE: _Pattern
23+
24+
MAC_MC: Final[_Pattern]
25+
MR_MRS_MS_DR: Final[_Pattern]
26+
INLINE_PERIOD: Final[_Pattern]
27+
UC_ELSEWHERE: Final[_Pattern]
28+
CAPFIRST: Final[_Pattern]
29+
APOS_SECOND: Final[_Pattern]
30+
UC_INITIALS: Final[_Pattern]
31+
32+
@type_check_only
33+
class _CallbackProtocol(Protocol):
3334
def __call__(self, word: str, /, *, all_caps: bool) -> str | None: ...
3435

3536
class Immutable: ...
@@ -42,7 +43,7 @@ def set_small_word_list() -> None: ...
4243
def set_small_word_list(small: str) -> None: ...
4344

4445
def titlecase(
45-
text: str, callback: CallbackProtocol | None = None, small_first_last: bool = True, preserve_blank_lines: bool = False
46+
text: str, callback: _CallbackProtocol | None = None, small_first_last: bool = True, preserve_blank_lines: bool = False
4647
) -> LiteralString: ...
47-
def create_wordlist_filter_from_file(file_path: str | None) -> CallbackProtocol: ...
48+
def create_wordlist_filter_from_file(file_path: str | None) -> _CallbackProtocol: ...
4849
def cmd() -> None: ...

0 commit comments

Comments
 (0)