Re: [Python-ideas] Way to repeat other than "for _ in range(x)"

2017-03-30 Thread Allan Clark
Sorry, that obviously should have been: d = [[0] * 5 for in range(10)] So it's not quite exactly the same as your example. On 30 March 2017 at 11:24, Allan Clark wrote: > If there were to be special syntax for this case, I'd just allow an > empty pattern, such as: > >

Re: [Python-ideas] Way to repeat other than "for _ in range(x)"

2017-03-30 Thread Allan Clark
If there were to be special syntax for this case, I'd just allow an empty pattern, such as: d = [[0] * 5 for in 10] This is exactly the same as your 'repeat_for' except that it is spelt 'for in', which means there are no new keywords. It would also be allowed in for-loops in the same way as y