A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-October/057045.html below:

[Python-Dev] Proposed changes to PEP 343

[Python-Dev] Proposed changes to PEP 343 [Python-Dev] Proposed changes to PEP 343Michael Hudson mwh at python.net
Fri Oct 7 15:02:12 CEST 2005
Nick Coghlan <ncoghlan at gmail.com> writes:

> What if we simply special-cased the __with__ slot in type(), such that if it 
> is populated with a generator object, that object is automatically wrapped 
> using the @contextmanager decorator? (Jason actually suggested this idea 
> previously)

<nit>
You don't want to check if it's a generator, you want to check if it's
a function whose func_code has the relavent bit set.
</nit>

Seems a bit magical to me, but haven't thought about it hard.

Cheers,
mwh

-- 
  I think my standards have lowered enough that now I think ``good
  design'' is when the page doesn't irritate the living fuck out of 
  me.                        -- http://www.jwz.org/gruntle/design.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