OK, I get it now. I really liked the analysis of existing uses in Django. So no worries about this.
On Wed, Aug 23, 2017 at 5:36 PM, Yury Selivanov <[email protected]> wrote: > There's another "major" problem with theading.local()-like API for PEP > 550: C API. > > threading.local() in C right now is PyThreadState_GetDict(), which > returns a dictionary for the current thread, that can be > queried/modified with PyDict_* functions. For PEP 550 this would not > work. > > The advantage of the current ContextKey solution is that the Python > API and C API are essentially the same: [1] > > Another advantage, is that ContextKey implements a better caching, > because it can have only one value cached in it, see [2] for details. > > [1] https://www.python.org/dev/peps/pep-0550/#new-apis > [2] https://www.python.org/dev/peps/pep-0550/#contextkey-get-cache > > Yury > -- --Guido van Rossum (python.org/~guido)
_______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
