Skip to content

Commit 35b64b1

Browse files
committed
Merge branch 'update-mypy'
2 parents adefa7a + 418e255 commit 35b64b1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup Python
3737
uses: actions/setup-python@v4
3838
with:
39-
python-version: 3.11
39+
python-version: 3.13
4040
- name: Install dependencies
4141
run: pip install '.[dev]'
4242
- name: Run mypy

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ dependencies = [
4646
dev = [
4747
"django-stubs",
4848
"djangorestframework-stubs",
49-
"mypy ~= 1.8.0",
49+
"mypy ~= 1.15.0",
5050
]
5151
test = [
5252
"coverage[toml]",

rest_framework_dataclasses/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _strip_empty_sentinels(data: AnyT, instance: Optional[AnyT] = None) -> AnyT:
6161
return cast(AnyT, [_strip_empty_sentinels(item) for item in data])
6262
elif isinstance(data, dict):
6363
return cast(AnyT, {key: _strip_empty_sentinels(value) for key, value in data.items()})
64-
return data
64+
return cast(AnyT, data)
6565

6666

6767
# noinspection PyMethodMayBeStatic

rest_framework_dataclasses/typing_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def get_iterable_element_type(tp: type) -> type:
126126
raise ValueError('get_iterable_element_type() called with non-iterable type.')
127127

128128
args = get_args(tp)
129-
return args[0] if len(args) > 0 else typing.Any
129+
return args[0] if len(args) > 0 else typing.Any # type: ignore
130130

131131

132132
def is_mapping_type(tp: type) -> bool:
@@ -156,7 +156,7 @@ def get_mapping_value_type(tp: type) -> type:
156156
raise ValueError('get_mapping_value_type() called with non-mapping type.')
157157

158158
args = get_args(tp)
159-
return args[1] if len(args) == 2 else typing.Any
159+
return args[1] if len(args) == 2 else typing.Any # type: ignore
160160

161161

162162
def is_optional_type(tp: type) -> bool:
@@ -278,7 +278,7 @@ def get_final_type(tp: type) -> type:
278278
raise ValueError('get_final_type() called with non-final type.')
279279

280280
args = get_args(tp)
281-
return args[0] if len(args) > 0 else typing.Any
281+
return args[0] if len(args) > 0 else typing.Any # type: ignore
282282

283283

284284
def is_type_variable(tp: type) -> bool:

0 commit comments

Comments
 (0)