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/2006-April/064297.html below:

[Python-Dev] PEP 343 update (with statement context terminology)

[Python-Dev] PEP 343 update (with statement context terminology) [Python-Dev] PEP 343 update (with statement context terminology)Phillip J. Eby pje at telecommunity.com
Mon Apr 24 22:40:21 CEST 2006
At 01:19 PM 4/24/2006 -0700, Aahz wrote:
>What is EXPRESSION, then?  Not the value it returns, but EXPRESSION
>itself -- does it have a name?  What about the kinds of things we use
>for EXPRESSION?

I read "EXPRESSION returns a value" as simply meaning that "value = 
EXPRESSION", i.e. that the result of computing EXPRESSION *is* the 
value.  That's what it usually means when we talk about expressions 
returning a value -- that computing the expression produces a value.

I still don't see a third thing here.  "EXPRESSION returns a value" (Thing 
1).  That value is "used to create a context" (by calling 
__context__).  This context (Thing 2) "is used to execute a block" (by 
calling __enter__ and __exit__).

I don't get how you can have a difference between "EXPRESSION" and "value 
it returns" unless you're bringing functions into play.  In everything else 
in Python, an expression *is* the value it returns.  How could it be otherwise?

Maybe you meant to write an explanation that included three objects, but 
what you wrote is actually a precise and accurate description of how things 
works.  The value produced by EXPRESSION is used to create a context, and 
the context is used to execute the block.  I don't know how you could 
explain it any more simply than that -- certainly not by adding a 
mysterious third gunman on the grassy knoll.  :)

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