On 8/28/2017 6:50 PM, Guido van Rossum wrote:
FWIW we *could* have a policy that OS threads also inherit the lookup chain from their creator, but I doubt that's going to fly with backwards compatibility.

Since LC is new, how could such a policy affect backwards compatibility?

The obvious answer would be that some use cases that presently use other mechanisms that "should" be ported to using LC would have to be careful in how they do the port, but discussion seems to indicate that they would have to be careful in how they do the port anyway.

One of the most common examples is the decimal context. IIUC, each thread gets its initial decimal context from a global template, rather than inheriting from its parent thread. Porting decimal context to LC then, in the event of OS threads inheriting the lookup chain from their creator, would take extra work for compatibility: setting the decimal context from the global template (a step it must already take) rather than accepting the inheritance.  It might be appropriate that an updated version of decimal that uses LC would offer the option of inheriting the decimal context from the parent thread, or using the global template, as an enhancement.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to