Implement a stub for netrc standard module (#2098)

This commit is contained in:
Andrew Svetlov
2018-05-06 12:25:40 +03:00
committed by Ivan Levkivskyi
parent 29bf24b8b9
commit 142c7488a5

19
stdlib/2and3/netrc.pyi Normal file
View File

@@ -0,0 +1,19 @@
from typing import AnyStr, Dict, List, Optional, Tuple, overload
class NetrcParseError(Exception):
filename: Optional[str]
lineno: Optional[int]
msg: str
# (login, account, password) tuple
_NetrcTuple = Tuple[str, Optional[str], Optional[str]]
class netrc:
hosts: Dict[str, _NetrcTuple]
macros: Dict[str, List[str]]
def __init__(self, file: str = ...) -> None: ...
def authenticators(self, host: str) -> Optional[_NetrcTuple]: ...