From d6e2b02f723af87d381e16e32f36bfd120f96d52 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 5 Jun 2019 02:59:32 -0700 Subject: [PATCH] Use custom tuple subclass for pwd.struct_passwd (#3017) --- stdlib/2and3/pwd.pyi | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stdlib/2and3/pwd.pyi b/stdlib/2and3/pwd.pyi index 5bd0bbb64..ea5845200 100644 --- a/stdlib/2and3/pwd.pyi +++ b/stdlib/2and3/pwd.pyi @@ -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: ...