3 ms·
I've not used co-routines in Python, but on those occasions when I have used them they have been ideal. Co-routines are a tool, and like any other, using in th
by RiderOfGiraffes 16y ago
I've not used co-routines in Python, but on those occasions when I have used them they have been ideal.
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.
I've used co-routines many times in the past 30 years, and they have been utterly indispensible.
Often instead of co-routines you can use generators in the same context. Worth considering. See here:
http://news.ycombinator.com/item?id=1742593 http://news.ycombinator.com/item?id=1742593