mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
24 lines
742 B
Python
24 lines
742 B
Python
import sys
|
|
from _typeshed import StrOrBytesPath
|
|
from typing_extensions import TypeAlias
|
|
|
|
__all__ = ["netrc", "NetrcParseError"]
|
|
|
|
class NetrcParseError(Exception):
|
|
filename: str | None
|
|
lineno: int | None
|
|
msg: str
|
|
def __init__(self, msg: str, filename: StrOrBytesPath | None = ..., lineno: int | None = ...) -> None: ...
|
|
|
|
# (login, account, password) tuple
|
|
if sys.version_info >= (3, 11):
|
|
_NetrcTuple: TypeAlias = tuple[str, str, str]
|
|
else:
|
|
_NetrcTuple: TypeAlias = tuple[str, str | None, str | None]
|
|
|
|
class netrc:
|
|
hosts: dict[str, _NetrcTuple]
|
|
macros: dict[str, list[str]]
|
|
def __init__(self, file: StrOrBytesPath | None = ...) -> None: ...
|
|
def authenticators(self, host: str) -> _NetrcTuple | None: ...
|