Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3dbaf34

Browse files
authored
yaml.cyaml: Switch Optional to new pipe-based union (#5971)
1 parent 47dd854 commit 3dbaf34

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

stubs/PyYAML/yaml/cyaml.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from _typeshed import SupportsRead
2-
from typing import IO, Any, Mapping, Optional, Sequence, Text, Union
2+
from typing import IO, Any, Mapping, Sequence, Text, Union
33

44
from yaml.constructor import BaseConstructor, Constructor, SafeConstructor
55
from yaml.events import Event
@@ -14,15 +14,15 @@ _Readable = SupportsRead[Union[Text, bytes]]
1414
class CParser:
1515
def __init__(self, stream: str | bytes | _Readable) -> None: ...
1616
def dispose(self) -> None: ...
17-
def get_token(self) -> Optional[Token]: ...
18-
def peek_token(self) -> Optional[Token]: ...
17+
def get_token(self) -> Token | None: ...
18+
def peek_token(self) -> Token | None: ...
1919
def check_token(self, *choices) -> bool: ...
20-
def get_event(self) -> Optional[Event]: ...
21-
def peek_event(self) -> Optional[Event]: ...
20+
def get_event(self) -> Event | None: ...
21+
def peek_event(self) -> Event | None: ...
2222
def check_event(self, *choices) -> bool: ...
2323
def check_node(self) -> bool: ...
24-
def get_node(self) -> Optional[Node]: ...
25-
def get_single_node(self) -> Optional[Node]: ...
24+
def get_node(self) -> Node | None: ...
25+
def get_single_node(self) -> Node | None: ...
2626

2727
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
2828
def __init__(self, stream: str | bytes | _Readable) -> None: ...

0 commit comments

Comments
 (0)