mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Add some missing annotations in cyaml (#2769)
* update annotation of cyaml * fix wrong type
This commit is contained in:
31
third_party/2and3/yaml/cyaml.pyi
vendored
31
third_party/2and3/yaml/cyaml.pyi
vendored
@@ -1,8 +1,10 @@
|
||||
from typing import Text, Union
|
||||
from typing import Any, IO, Mapping, Optional, Sequence, Text, Union
|
||||
from typing_extensions import Protocol
|
||||
|
||||
from yaml.constructor import BaseConstructor, SafeConstructor
|
||||
from yaml.constructor import BaseConstructor, Constructor, SafeConstructor
|
||||
from yaml.representer import BaseRepresenter, Representer, SafeRepresenter
|
||||
from yaml.resolver import BaseResolver, Resolver
|
||||
from yaml.serializer import Serializer
|
||||
|
||||
class _Readable(Protocol):
|
||||
def read(self, size: int) -> Union[Text, bytes]: ...
|
||||
@@ -18,3 +20,28 @@ class CLoader(CParser, SafeConstructor, Resolver):
|
||||
|
||||
class CSafeLoader(CParser, SafeConstructor, Resolver):
|
||||
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...
|
||||
|
||||
class CDangerLoader(CParser, Constructor, Resolver): ... # undocumented
|
||||
|
||||
class CEmitter(object):
|
||||
def __init__(self, stream: IO[Any], canonical: Optional[Any] = ...,
|
||||
indent: Optional[int] = ..., width: Optional[int] = ...,
|
||||
allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ...,
|
||||
encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ...,
|
||||
explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ...,
|
||||
tags: Optional[Mapping[Text, Text]] = ...) -> None: ...
|
||||
|
||||
class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver):
|
||||
def __init__(self, stream: IO[Any], default_style: Optional[str] = ...,
|
||||
default_flow_style: Optional[bool] = ..., canonical: Optional[Any] = ...,
|
||||
indent: Optional[int] = ..., width: Optional[int] = ...,
|
||||
allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ...,
|
||||
encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ...,
|
||||
explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ...,
|
||||
tags: Optional[Mapping[Text, Text]] = ...) -> None: ...
|
||||
|
||||
class CDumper(CEmitter, SafeRepresenter, Resolver): ...
|
||||
|
||||
CSafeDumper = CDumper
|
||||
|
||||
class CDangerDumper(CEmitter, Serializer, Representer, Resolver): ... # undocumented
|
||||
|
||||
Reference in New Issue
Block a user