From 180f4193dcf3b28c3f67c969f74a99a7bf1c35fe Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 14 May 2024 21:30:02 -0400 Subject: [PATCH] | None --- mypy/semanal_namedtuple.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mypy/semanal_namedtuple.py b/mypy/semanal_namedtuple.py index 56104c1ffc46..4c4caa80353a 100644 --- a/mypy/semanal_namedtuple.py +++ b/mypy/semanal_namedtuple.py @@ -7,7 +7,7 @@ import keyword from contextlib import contextmanager -from typing import Container, Final, Iterator, List, Mapping, Optional, cast +from typing import Container, Final, Iterator, List, Mapping, cast from mypy.exprtotype import TypeTranslationError, expr_to_unanalyzed_type from mypy.messages import MessageBuilder @@ -688,7 +688,7 @@ def save_namedtuple_body(self, named_tuple_info: TypeInfo) -> Iterator[None]: # Helpers - def check_namedtuple_field_name(self, field: str, seen_names: Container[str]) -> Optional[str]: + def check_namedtuple_field_name(self, field: str, seen_names: Container[str]) -> str | None: """Return None for valid fields, a string description for invalid ones.""" if field in seen_names: return f'has duplicate field name "{field}"'