Skip to content

Commit 3112f0e

Browse files
authored
_typeshed.structseq: Use Final instead of ClassVar (#6825)
1 parent ca7e096 commit 3112f0e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/_typeshed/__init__.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import ctypes
77
import mmap
88
import sys
99
from os import PathLike
10-
from typing import AbstractSet, Any, Awaitable, ClassVar, Container, Generic, Iterable, Protocol, Type, TypeVar, Union
11-
from typing_extensions import Literal, final
10+
from typing import AbstractSet, Any, Awaitable, Container, Generic, Iterable, Protocol, Type, TypeVar, Union
11+
from typing_extensions import Final, Literal, final
1212

1313
_KT = TypeVar("_KT")
1414
_KT_co = TypeVar("_KT_co", covariant=True)
@@ -206,9 +206,9 @@ else:
206206
# See discussion at #6546 & #6560
207207
# `structseq` classes are unsubclassable, so are all decorated with `@final`.
208208
class structseq(Generic[_T_co]):
209-
n_fields: ClassVar[int]
210-
n_unnamed_fields: ClassVar[int]
211-
n_sequence_fields: ClassVar[int]
209+
n_fields: Final[int]
210+
n_unnamed_fields: Final[int]
211+
n_sequence_fields: Final[int]
212212
# The first parameter will generally only take an iterable of a specific length.
213213
# E.g. `os.uname_result` takes any iterable of length exactly 5.
214214
#

0 commit comments

Comments
 (0)