Skip to content

Commit a427377

Browse files
slip in a cheeky little Any, to match the other cheeky little Anys in the calling code
1 parent b32e01e commit a427377

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

mypy/config_parser.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ def parse_version(v: str | float) -> tuple[int, int]:
6060
return major, minor
6161

6262

63-
def try_split(v: str | Sequence[str], split_regex: str = "[,]") -> list[str]:
63+
def try_split(v: str | Sequence[str] | Any, split_regex: str = "[,]") -> list[str] | Any:
6464
"""Split and trim a str or sequence (eg: list) of str into a list of str.
65-
Non-str elements will simply be returned untouched. This is not documented
66-
by the types but there was no type error before this bugfix, so we must be
67-
type-ignoring elsewhere. Feel free to fix that."""
65+
Non-str elements will simply be returned untouched. Feel free to one day
66+
fix the typing of the calling code, and remove this caveat and Any."""
6867
if isinstance(v, str):
6968
items = [p.strip() for p in re.split(split_regex, v)]
7069
if items and items[-1] == "":

test-data/unit/check-flags.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,4 +2488,3 @@ def f():
24882488
[file pyproject.toml]
24892489
\[tool.mypy]
24902490
enable_error_code = true
2491-

0 commit comments

Comments
 (0)