Marked the bool class as @final because it cannot be subclassed. (#5286)

Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
Eric Traut
2021-05-01 21:38:10 -07:00
committed by GitHub
parent 445a86f4c9
commit 58e083fef9
3 changed files with 6 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ from typing import (
ValuesView,
overload,
)
from typing_extensions import Literal, SupportsIndex
from typing_extensions import Literal, SupportsIndex, final
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -666,6 +666,7 @@ class memoryview(Sized, Container[int]):
else:
def hex(self) -> str: ...
@final
class bool(int):
def __new__(cls: Type[_T], __o: object = ...) -> _T: ...
@overload