<div dir="ltr">* Sorry, message sent too early:<div><br></div><div><span class="gmail-im" style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">On Thu, May 31, 2018 at 4:50 AM, Neil Girdhar<span> </span><span dir="ltr"><<a href="mailto:mistersheik@gmail.com" target="_blank" style="color:rgb(17,85,204)">mistersheik@gmail.com</a>></span><span> </span>wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br> [expression given name=something for x in seq]<br></blockquote><div><br></div></span><div>retval = []</div><div>name = something</div><div>for x in seq:</div><div> retval.append(expression)</div><div>return retval</div></div></div></blockquote><div><br></div></span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">That's a little confusing then, because, given the way given is used outside of comprehensions, you would expect </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> [y given y=2*x for x in range(3)] </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">to return [0, 2, 4], but it would actually raise an error. </div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 31, 2018 at 10:32 AM, Peter O'Connor <span dir="ltr"><<a href="mailto:peter.ed.oconnor@gmail.com" target="_blank">peter.ed.oconnor@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, May 31, 2018 at 4:50 AM, Neil Girdhar <span dir="ltr"><<a href="mailto:mistersheik@gmail.com" target="_blank">mistersheik@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
[expression given name=something for x in seq]<br></blockquote><div><br></div></span><div>retval = []</div><div>name = something</div><div>for x in seq:</div><div> retval.append(expression)</div><div>return retval</div></div></div></blockquote><div><br></div></span><div>That's a little strange confusing then, because, given the way given is used outside of comprehensions, you would expect </div><div><br></div><div>for x in range(3):</div><div>y given y=2*x</div><div><br></div><div> [y given y=2*x for x in range(3)] </div><div><br></div><div>to return [0, 2, 4], but it would actually raise an error. </div><div><br></div><div><br></div><div> <br></div></div></div></div>
</blockquote></div><br></div>