Skip to content

Commit

Permalink
Use custom tuple subclass for pwd.struct_passwd (python#3017)
Browse files Browse the repository at this point in the history
benjaminp authored and srittau committed Jun 5, 2019
1 parent a778515 commit d6e2b02
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions stdlib/2and3/pwd.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from typing import List, NamedTuple
from typing import List, Tuple

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)])
class struct_passwd(Tuple[str, str, int, int, str, str, str]):
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: ...

0 comments on commit d6e2b02

Please sign in to comment.