Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stub for toml #2355

Merged
merged 4 commits into from
Aug 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions third_party/2and3/toml.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from typing import Any, IO, List, Mapping, MutableMapping, Optional, Protocol, Text, Type, Union
import datetime
import sys

if sys.version_info >= (3, 4):
import pathlib
if sys.version_info >= (3, 6):
import os
_PathLike = Union[Text, pathlib.PurePath, os.PathLike]
else:
_PathLike = Union[Text, pathlib.PurePath]
else:
_PathLike = Text

class _Writable(Protocol):
def write(self, obj: str) -> Any: ...

class TomlDecodeError(Exception): ...

def load(f: Union[_PathLike, List[Text], IO[str]], _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ...
def loads(s: Text, _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ...

def dump(o: Mapping[str, Any], f: _Writable) -> str: ...
def dumps(o: Mapping[str, Any]) -> str: ...