[Python-Dev] PEP 550 v4

Glenn Linderman v+python at g.nevcal.com
Mon Aug 28 22:55:07 EDT 2017


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170828/151e671d/attachment.html>


More information about the Python-Dev mailing list