A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-September/149295.html below:

[Python-Dev] PEP 550 v4

[Python-Dev] PEP 550 v4 [Python-Dev] PEP 550 v4Elvis Pranskevichus elprans at gmail.com
Thu Sep 7 10:13:46 EDT 2017
On Thursday, September 7, 2017 6:37:58 AM EDT Greg Ewing wrote:
> 2) You ignore it and always use a context manager, in
> which case it's not strictly necessary for the implicit
> context push to occur, since the relevant context managers
> can take care of it.
> 
> So there doesn't seem to be any great advantage to the
> automatic context push, and it has some disadvantages,
> such as yield-from not quite working as expected in
> some situations.

The advantage is that context managers don't need to *always* 
allocate and push an LC. [1]

> Also, it seems that every generator is going to incur
> the overhead of allocating a logical_context even when
> it doesn't actually change any context vars, which most
> generators won't.

By default, generators reference an empty LogicalContext object that is 
allocated once (like the None object).  We can do that because LCs are 
immutable. 

                          Elvis


[1] https://mail.python.org/pipermail/python-dev/2017-September/
149265.html
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4