-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Update pwd stub file #5741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update pwd stub file #5741
Conversation
Add the following properties to struct_passwd: * n_fields * n_sequence_fields * n_unnamed_fields To fix the following errors: * pwd.struct_passwd.n_fields is not present in stub * pwd.struct_passwd.n_sequence_fields is not present in stub * pwd.struct_passwd.n_unnamed_fields is not present in stub
This comment has been minimized.
This comment has been minimized.
Could you reformat with Black? |
Yes I could reformat with Black --Nsukami_
|
This comment has been minimized.
This comment has been minimized.
PIL error is unrelated to this PR. See #5746 |
stdlib/pwd.pyi
Outdated
@property | ||
def n_fields(self) -> int: ... | ||
@property | ||
def n_sequence_fields(self) -> int: ... | ||
@property | ||
def n_unnamed_fields(self) -> int: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are actually class properties:
srittau@blitz:~$ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pwd
>>> pwd.struct_passwd.n_fields
7
>>>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe:
@property | |
def n_fields(self) -> int: ... | |
@property | |
def n_sequence_fields(self) -> int: ... | |
@property | |
def n_unnamed_fields(self) -> int: ... | |
n_fields: ClassVar[int] | |
n_sequence_fields: ClassVar[int] | |
n_unnamed_fields: ClassVar[int] |
You will need to add from typing import ClassVar
.
This comment has been minimized.
This comment has been minimized.
…elds properties Those properties are not simple integers, they are also class variables.
You need to run |
This comment has been minimized.
This comment has been minimized.
Thanks a lot for your time, advices & suggestions 😆 |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Add the following properties to struct_passwd:
To fix the following errors: