From 142c7488a579c3ab51e2bb6f6a180d5748fa8666 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 6 May 2018 12:25:40 +0300 Subject: [PATCH] Implement a stub for netrc standard module (#2098) --- stdlib/2and3/netrc.pyi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 stdlib/2and3/netrc.pyi diff --git a/stdlib/2and3/netrc.pyi b/stdlib/2and3/netrc.pyi new file mode 100644 index 000000000..3ceae8899 --- /dev/null +++ b/stdlib/2and3/netrc.pyi @@ -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]: ...