Skip to content

Commit bad2fea

Browse files
authored
Use Literal for MatchSingleton (#5590)
1 parent 200260e commit bad2fea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/_ast.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
import typing
33
from typing import Any, ClassVar, Optional
4+
from typing_extensions import Literal
45

56
PyCF_ONLY_AST: int
67
if sys.version_info >= (3, 8):
@@ -390,7 +391,7 @@ if sys.version_info >= (3, 10):
390391
class MatchValue(pattern):
391392
value: expr
392393
class MatchSingleton(pattern):
393-
value: Optional[bool]
394+
value: Literal[True, False, None]
394395
class MatchSequence(pattern):
395396
patterns: typing.List[pattern]
396397
class MatchStar(pattern):

0 commit comments

Comments
 (0)