Added cyaml.pyi (#2613)

Closes #1996
This commit is contained in:
Keith Gray
2018-11-24 11:13:14 -06:00
committed by Sebastian Rittau
parent 172b384e23
commit 9c3978e337
2 changed files with 21 additions and 2 deletions

View File

@@ -6,8 +6,7 @@ from yaml.nodes import * # noqa: F403
from yaml.loader import * # noqa: F403
from yaml.dumper import * # noqa: F403
from . import resolver # Help mypy a bit; this is implied by loader and dumper
# TODO: stubs for cyaml?
# from cyaml import *
from .cyaml import *
__with_libyaml__ = ... # type: Any

20
third_party/2and3/yaml/cyaml.pyi vendored Normal file
View File

@@ -0,0 +1,20 @@
from typing import Text, Union
from typing_extensions import Protocol
from yaml.constructor import BaseConstructor, SafeConstructor
from yaml.resolver import BaseResolver, Resolver
class _Readable(Protocol):
def read(self, size: int) -> Union[Text, bytes]: ...
class CParser:
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...
class CLoader(CParser, SafeConstructor, Resolver):
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...
class CSafeLoader(CParser, SafeConstructor, Resolver):
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...