mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Update stub for spwd (#1372)
Update stub for spwd
- Use `NamedTuple`
- Fix stub for Python 3
- Some attributes are changed from Python 2
- `sp_nam` -> `sp_namp`
- `sp_pwd` -> `sp_pwdp`
This commit is contained in:
committed by
Guido van Rossum
parent
6f07424246
commit
193e6885d4
14
stdlib/2/spwd.pyi
Normal file
14
stdlib/2/spwd.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import List, NamedTuple
|
||||
|
||||
struct_spwd = NamedTuple("struct_spwd", [("sp_nam", str),
|
||||
("sp_pwd", str),
|
||||
("sp_lstchg", int),
|
||||
("sp_min", int),
|
||||
("sp_max", int),
|
||||
("sp_warn", int),
|
||||
("sp_inact", int),
|
||||
("sp_expire", int),
|
||||
("sp_flag", int)])
|
||||
|
||||
def getspall() -> List[struct_spwd]: ...
|
||||
def getspnam(name: str) -> struct_spwd: ...
|
||||
@@ -1,15 +0,0 @@
|
||||
from typing import List
|
||||
|
||||
class struct_spwd(object):
|
||||
sp_nam = ... # type: str
|
||||
sp_pwd = ... # type: str
|
||||
sp_lstchg = ... # type: int
|
||||
sp_min = ... # type: int
|
||||
sp_max = ... # type: int
|
||||
sp_warn = ... # type: int
|
||||
sp_inact = ... # type: int
|
||||
sp_expire = ... # type: int
|
||||
sp_flag = ... # type: int
|
||||
|
||||
def getspall() -> List[struct_spwd]: ...
|
||||
def getspnam(name: str) -> struct_spwd: ...
|
||||
14
stdlib/3/spwd.pyi
Normal file
14
stdlib/3/spwd.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import List, NamedTuple
|
||||
|
||||
struct_spwd = NamedTuple("struct_spwd", [("sp_namp", str),
|
||||
("sp_pwdp", str),
|
||||
("sp_lstchg", int),
|
||||
("sp_min", int),
|
||||
("sp_max", int),
|
||||
("sp_warn", int),
|
||||
("sp_inact", int),
|
||||
("sp_expire", int),
|
||||
("sp_flag", int)])
|
||||
|
||||
def getspall() -> List[struct_spwd]: ...
|
||||
def getspnam(name: str) -> struct_spwd: ...
|
||||
Reference in New Issue
Block a user