Added stub for user module#1454
Conversation
|
This seems like a bit of a special case, in that it's intended to include arbitrary user-specified code. I think we should add a module-level |
stdlib/2/user.pyi
Outdated
|
|
||
|
|
||
| home: str | ||
| pythonrc: Union[bytes, Text] |
There was a problem hiding this comment.
In this case yes, but it can return both in general.
There was a problem hiding this comment.
Well, in this case all the arguments are bytes, so the return will also be bytes.
stdlib/2/user.pyi
Outdated
|
|
||
| home: str | ||
| pythonrc: Union[bytes, Text] | ||
| f: BinaryIO |
There was a problem hiding this comment.
This may not exist (it will only exist if ~/.pythonrc.py exists).
There was a problem hiding this comment.
@JelleZijlstra How do we deal with variables that may or may not exist?
Secondly is it okay if I include few more stubs in the same PR?
There was a problem hiding this comment.
I think the module-level __getattr__ should suffice and we can just omit f.
There was a problem hiding this comment.
Also, please submit stubs for other modules as separate PRs.
|
To fix the test failure, you can add |
* python/master: Added stub for toaiff module (python#1455) Added stub for user module (python#1454) Add more multiprocessing function stubs (python#1435) PyYaml: uncomment commented out imports and add missing classmethod decorators (python#1439) Allow `os.readlink` to accept path-like objects (python#1441) Support named attributes in `os.uname()` result (python#1445) Fix signature for slite3.fetchmany (python#1444) Add __name__ field to MethodType (python#1442) Add TypedDict total argument (python#1443)
Related to: #1147