News for hackers. Stuff that matters.
Re:The Python yield keyword explained by markmywords on Saturday August 14, 2010 @10:18AM (#1603356)
Thank you for linking this. It may not be hot news or a trendy topic but it was a very good read and a good refresher :)
Re:The Python yield keyword explained by iamelgringo on Saturday August 14, 2010 @11:13PM (#1604506)
I'm glad you liked it. i've recently discovered the awesomeness of generators, and I'm starting to use them a lot in my code. I don't see them a lot in other people's code that I read, so I figure I'd spread the word a bit.
Re:The Python yield keyword explained by rlander on Sunday August 15, 2010 @02:55AM (#1604728)
Although I agree it was an interesting read and I do like this language feature, I think generators should be used with caution since they might detract from the code's readability (especially generator expressions). Some async libraries like dieselweb just use them too much for my taste.
Re:The Python yield keyword explained by ntoshev on Sunday August 15, 2010 @07:19AM (#1604940)
Generators actually allow you to decouple code in more ways than normal functions and classes let you. See the "Why functional programming matters" paper, or the more practical presentation here:

http://www.dabeaz.com/generators/Generators.pdf

Re:The Python yield keyword explained by rlander on Sunday August 15, 2010 @02:35PM (#1605618)
Wow, excellent resource, definitely a must-read. However, I still stand by my opinion that there are more intuitive ways to control flow in python other than generator tricks.