-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
In the past week alone I've seen several issues where well-meaning contributors wanted to add undocumented attributes to typeshed:
- Add _taskqueue to MP Pool #1884
- Extend Py3 Queue type hints #1885
- Add stub for subprocess.list2cmdline function #1898
- Python 3 HTTPConnection stubs missing class variables #1901
I think we should have a standard policy on these. I know in the past we've sometimes added such attributes, with the argument that there's existing working code that uses them. But AFAIK there's no other tool that is capable of flagging the use of undocumented attributes, so I'm kind of leaning towards seeing this as a valuable service mypy (or rather, typeshed) provides, rather than a deficiency in the stubs. For example, if we were to add these attributes to the stubs, IDEs like PyCharm would start suggesting auto-completion for undocumented attributes, which I definitely think is a bad idea. If there's something that's commonly used, it should just be included in the docs first -- the process for that is clear (file an issue on bugs.python.org).