[Python-ideas] PEP draft: context variables

Koos Zevenhoven k7hoven at gmail.com
Thu Oct 12 17:48:20 EDT 2017


On Oct 12, 2017 9:03 PM, "Yury Selivanov" <yselivanov.ml at gmail.com> wrote:

On Thu, Oct 12, 2017 at 8:59 AM, Koos Zevenhoven <k7hoven at gmail.com> wrote:
> On Thu, Oct 12, 2017 at 6:54 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
[..]
>> 1. Preserve the current behaviour, since we don't have a compelling
reason
>> to change its semantics
>> 2. Change the behaviour, in order to gain <end user benefit>
>>
>
> 3. Introduce a new context manager that behaves intuitively. My guess is
> that the two context managers could even be made to interact with each
other
> in a fairly reasonable manner, even if you nest them in different orders.
> I'm not sure how necessary that is.

Note that this is an independent argument w.r.t. both PEPs.  PEP 550
does not propose to change existing decimal APIs.  It merely uses
decimal to illustrate the problem, and suggests a fix using the new
APIs.


Of course this particular point is independent. But not all the other
points are.


Although it is true that I plan to propose to use PEP 550 to
reimplement decimal APIs on top of it, and so far I haven't seen any
real-world examples of code that will be broken because of that.  As
far as I know—and I've done some research—nobody uses decimal contexts

and generators because of the associated problems.  It's a chicken and
egg problem.


I've been inclined to think so too. But that kind of research would be
useful for decimal if—and only if—you share your methodology. It's not at
all clear how one would do research to arrive at such a conclusion.

—Koos (mobile)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171013/4d47864e/attachment.html>


More information about the Python-ideas mailing list