diff --git a/stdlib/2/pwd.pyi b/stdlib/2/pwd.pyi deleted file mode 100644 index ff6c6a42f..000000000 --- a/stdlib/2/pwd.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from typing import List - -class struct_passwd(tuple): - n_fields = ... # type: int - n_sequence_fields = ... # type: int - n_unnamed_fields = ... # type: int - pw_dir = ... # type: str - pw_name = ... # type: str - pw_passwd = ... # type: str - pw_shell = ... # type: str - pw_gecos = ... # type: str - pw_gid = ... # type: int - pw_uid = ... # type: int - -def getpwall() -> List[struct_passwd]: ... -def getpwnam(name: str) -> struct_passwd: ... -def getpwuid(uid: int) -> struct_passwd: ... diff --git a/stdlib/2and3/pwd.pyi b/stdlib/2and3/pwd.pyi new file mode 100644 index 000000000..5bd0bbb64 --- /dev/null +++ b/stdlib/2and3/pwd.pyi @@ -0,0 +1,13 @@ +from typing import List, NamedTuple + +struct_passwd = NamedTuple("struct_passwd", [("pw_name", str), + ("pw_passwd", str), + ("pw_uid", int), + ("pw_gid", int), + ("pw_gecos", str), + ("pw_dir", str), + ("pw_shell", str)]) + +def getpwall() -> List[struct_passwd]: ... +def getpwuid(uid: int) -> struct_passwd: ... +def getpwnam(name: str) -> struct_passwd: ... diff --git a/stdlib/3/pwd.pyi b/stdlib/3/pwd.pyi deleted file mode 100644 index a5a8171c3..000000000 --- a/stdlib/3/pwd.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for pwd - -# NOTE: These are incomplete! - -import typing - -class struct_passwd: - # TODO use namedtuple - pw_name = ... # type: str - pw_passwd = ... # type: str - pw_uid = 0 - pw_gid = 0 - pw_gecos = ... # type: str - pw_dir = ... # type: str - pw_shell = ... # type: str - -def getpwuid(uid: int) -> struct_passwd: ... -def getpwnam(name: str) -> struct_passwd: ...