This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: threading.local documentation should be on the net...
Type: enhancement Stage:
Components: Documentation Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, posita, rhettinger, ztane
Priority: normal Keywords: newcomer friendly

Created on 2020-11-13 11:17 by ztane, last changed 2022-04-11 14:59 by admin.

Messages (4)
msg380875 - (view) Author: Antti Haapala (ztane) * Date: 2020-11-13 11:17
The current documentation of `thread.local` is 

Thread-Local Data

Thread-local data is data whose values are thread specific. To manage thread-local data, just create an instance of local (or a subclass) and store attributes on it:

mydata = threading.local()
mydata.x = 1

The instance’s values will be different for separate threads.

class threading.local

    A class that represents thread-local data.

    For more details and extensive examples, see the documentation string of the _threading_local module.

There is no link to the `_threading_local` module docs in the documentation and none of the content from the modules docstrings appear  anywhere on website. This is rather annoying because the docstring contains completely non-trivial information including that threading.local can be subclassed and that the __init__ will be run once for each thread for each instance where attributes are accessed.
msg380999 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-11-15 06:14
Would you like to make a PR to fix it?
msg411858 - (view) Author: Matt B (posita) * Date: 2022-01-27 11:53
@rhettinger, the docstring[1] alluded to in the docs is quite lengthy. Are you suggesting copying it straight across to the standard library documentation? If not, can you give (or link to) some documentation standards or other guidance on constructing a viable PR?

Also, for newcomer friendly issues, it is helpful to link to instructions on how to construct and submit a PR for review. That will increase the likelihood of a community-provided fix.

msg411860 - (view) Author: Matt B (posita) * Date: 2022-01-27 11:56
@ztane, if you are interested in trying your hand at a PR, these will be generally useful:

Date User Action Args
2022-04-11 14:59:38adminsetgithub: 86509
2022-01-27 11:56:52positasetmessages: + msg411860
2022-01-27 11:53:41positasetnosy: + posita
messages: + msg411858
2020-11-15 06:14:22rhettingersetkeywords: + newcomer friendly
nosy: + rhettinger
messages: + msg380999

2020-11-13 11:17:53ztanecreate