I've been tempted to start using coroutines in my Python code, but I'm concerned I might be shooting myself in the foot by using them.<p>What's your experience using coroutines? Good? Bad? Ugly?
There's nothing magic - but there are a ton of libraries which make it better than what's in core. I'd recommend taking a look at monocle, eventlet/greenlet, and the other libs out there rather than trying to go it alone.
I've not used co-routines in Python, but on those occasions when I have used them they have been ideal.<p>Co-routines are a tool, and like any other, using in the wrong way, for the wrong thing, or badly, makes more problems than it solves. When used carefully and appropriately, the code is cleaner, clearer, and simply better.<p>I've used co-routines many times in the past 30 years, and they have been utterly indispensible.<p>Often instead of co-routines you can use generators in the same context. Worth considering. See here:<p><a href="http://news.ycombinator.com/item?id=1742593" rel="nofollow">http://news.ycombinator.com/item?id=1742593</a>