From 3112f0e5256ad77e1a50f669cbfeba0d0024fd99 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 5 Jan 2022 12:16:57 +0000 Subject: [PATCH] `_typeshed.structseq`: Use `Final` instead of `ClassVar` (#6825) --- stdlib/_typeshed/__init__.pyi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/_typeshed/__init__.pyi b/stdlib/_typeshed/__init__.pyi index a7f8c5147..c52f3e0da 100644 --- a/stdlib/_typeshed/__init__.pyi +++ b/stdlib/_typeshed/__init__.pyi @@ -7,8 +7,8 @@ import ctypes import mmap import sys from os import PathLike -from typing import AbstractSet, Any, Awaitable, ClassVar, Container, Generic, Iterable, Protocol, Type, TypeVar, Union -from typing_extensions import Literal, final +from typing import AbstractSet, Any, Awaitable, Container, Generic, Iterable, Protocol, Type, TypeVar, Union +from typing_extensions import Final, Literal, final _KT = TypeVar("_KT") _KT_co = TypeVar("_KT_co", covariant=True) @@ -206,9 +206,9 @@ else: # See discussion at #6546 & #6560 # `structseq` classes are unsubclassable, so are all decorated with `@final`. class structseq(Generic[_T_co]): - n_fields: ClassVar[int] - n_unnamed_fields: ClassVar[int] - n_sequence_fields: ClassVar[int] + n_fields: Final[int] + n_unnamed_fields: Final[int] + n_sequence_fields: Final[int] # The first parameter will generally only take an iterable of a specific length. # E.g. `os.uname_result` takes any iterable of length exactly 5. #