Message190542
+1 for adding this. It's simple to implement, simple to explain and the alternatives for dealing with the empty iterable case (or even the fact it may need to be handled at all) are definitely not obvious.
The relationship to next() is straightforward: the supplied value is effectively used as the default value for the first next call when iterating and then ignored thereafter. |
|
Date |
User |
Action |
Args |
2013-06-03 12:51:44 | ncoghlan | set | recipients:
+ ncoghlan, twouters, rhettinger, r.david.murray, skrah, Julian |
2013-06-03 12:51:44 | ncoghlan | set | messageid: <1370263904.88.0.902374192219.issue18111@psf.upfronthosting.co.za> |
2013-06-03 12:51:44 | ncoghlan | link | issue18111 messages |
2013-06-03 12:51:44 | ncoghlan | create | |
|