Re: [Python-ideas] Add optional defaults to namedtuple

2016-12-01 Thread Jelle Zijlstra
2016-11-30 8:11 GMT-08:00 Guido van Rossum : > On Wed, Nov 30, 2016 at 7:09 AM, Ethan Furman wrote: > >> On 11/30/2016 02:32 AM, Jelte Fennema wrote: >> >> It would be nice to have a supported way to add defaults to namedtuple, >>> so the slightly hacky

Re: [Python-ideas] Allow random.choice, random.sample to work on iterators

2016-12-01 Thread Sjoerd Job Postmus
On Wed, Nov 30, 2016 at 02:32:54PM -0600, Nick Timkovich wrote: > a generator with known length that's not indexable (a rare beast?). Not as rare as you might think: >>> k = set(range(10)) >>> len(k) 10 >>> k[3] Traceback (most recent call last): File "", line 1, in TypeError: 'set' object