Skip to content

Commit a3f70d3

Browse files
committed
Use warn_unreachable as well
1 parent 0f44034 commit a3f70d3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/tomllib/_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def get_or_create_nest(
273273
*,
274274
access_lists: bool = True,
275275
) -> dict[str, Any]:
276-
cont = self.dict
276+
cont: Any = self.dict
277277
for k in key:
278278
if k not in cont:
279279
cont[k] = {}
@@ -282,7 +282,7 @@ def get_or_create_nest(
282282
cont = cont[-1]
283283
if not isinstance(cont, dict):
284284
raise KeyError("There is no nest behind this key")
285-
return cont
285+
return cont # type: ignore[no-any-return]
286286

287287
def append_nest_to_list(self, key: Key) -> None:
288288
cont = self.get_or_create_nest(key[:-1])

Lib/tomllib/mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ enable_error_code = ignore-without-code
1414
strict = True
1515
strict_bytes = True
1616
local_partial_types = True
17+
warn_unreachable = True

0 commit comments

Comments
 (0)