<div dir="ltr">Harry <div><i>//excursus on the moan </i><div>The problem with  seems to be with scopes vs namespace differentiation rather than comprehensions (though I haven't *actually* tried this in python 3). So this problem only should occur in class bodies. And doing heavy lifting stuff like comprehensions in a class body is a bit dangerous, and you'd be better off doing it "properly" with a bit of metaprogramming  or wrapping it in function (which you could actually call in the body of the module after class definition and then modify the class after creation)</div>
<div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 30 May 2014 15:01, Harry Percival <span dir="ltr"><<a href="mailto:harry.percival@gmail.com" target="_blank">harry.percival@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"><div><div><div><div><div>Hi Uk-Pythoneers!<br><br></div><i>(with apologies to the wise ones amongst us who have chosen to live well away from the Big Smoke)</i><br>
<br></div>I'm involved in a couple of Python/TDD things in the next couple of weeks, both free to attend:<br>

<br><br></div><div>Outside-In TDD and Test Isolation: <a href="https://skillsmatter.com/meetups/6410-outside-in-tdd-and-test-isolation-how-to-use-the-pain-of-horrible-mocks-to-drive-better-design" target="_blank">https://skillsmatter.com/meetups/6410-outside-in-tdd-and-test-isolation-how-to-use-the-pain-of-horrible-mocks-to-drive-better-design</a><br>


</div><div>(all about testing, isolation, mocking, and the pains thereof... it may to provide some insight into the #TDDisDead / DHH controversy, if you've been following that)<br></div><div><br></div>Introduction to TDD workshop with Andrea Crotti:  <a href="https://skillsmatter.com/meetups/6424-obey-the-testing-goat" target="_blank">https://skillsmatter.com/meetups/6424-obey-the-testing-goat</a><br>


</div>(a gentle introduction to TDD with Django, for anyone that can't make it to EuroPython this year)<br><br></div>Hope they're of interest!<br><br>HP<br><br>PS Can I have a little moan about generator / list comprehension scoping in Python 3?  I just ran into this: <a href="https://stackoverflow.com/questions/11669379/undefined-global-in-list-generator-expression-using-python3-works-with-python2" target="_blank">https://stackoverflow.com/questions/11669379/undefined-global-in-list-generator-expression-using-python3-works-with-python2</a> -- so now I can't use variables from the enclosing scope inside my comprehensions?  that sucks!  Doesn't it?<span class="HOEnZb"><font color="#888888"><br>


<br><br><div><br clear="all"><div><div><div><div><div><div><br>-- <br>------------------------------<br>Harry J.W. Percival<br>------------------------------<br>Twitter: @hjwp<br>Mobile:  <a href="tel:%2B44%20%280%29%2078877%2002511" value="+447887702511" target="_blank">+44 (0) 78877 02511</a><br>
Skype:         harry.percival
</div></div></div></div></div></div></div></font></span></div>
<br>_______________________________________________<br>
python-uk mailing list<br>
<a href="mailto:python-uk@python.org">python-uk@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-uk" target="_blank">https://mail.python.org/mailman/listinfo/python-uk</a><br>
<br></blockquote></div><br></div>