<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 13, 2013 at 1:23 PM, Terry Jan Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":2wp">x = class (): pass<br>
x = with open(..):<br>
x = import itertools<br>
x = if True: y = 3<br>
x = <pick any statement other than expression/binding statements></div></blockquote></div><br>I can explain. </div><div class="gmail_extra"><br></div><div class="gmail_extra" style>Expressions like "", [], (), {} are called "constructors" in programming language theory, because the "construct" objects, and give them an initial state.</div>

<div class="gmail_extra" style><br></div><div class="gmail_extra" style>In Python, functions, methods, and classes are objects too, and their constructors are "class" and "def". But there's an asymmetry in the language in that those two constructors don't produce an assignable value.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">if, while, with, etc. are statements, not constructors. Other languages make those return values too, but that's not the Python way of things.</div><div class="gmail_extra">

<br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(0,102,0)">Juancarlo </span><b style="color:rgb(0,102,0)">Añez</b>
</div></div>