Yes. Early on in my career, I needed a function that produced a range of dates, given a start and end date. After it was all said and done, it boiled out like so: def daterange(start,end): while start Though simplistic and straightforward, I admire the solution. I am sure there may be “better” ways to achieve the same result, and posting this here may result in cowboys trashing it or pointing out a fallacy - oh well.…
Apply generator expressions, format them with map, filter out weekends, anything in itertools (dropwhile, takewhile), etc.
I wrote a datepicker to demonstrate some concepts like lazy evaluation with JavaScript generators and it was fun coming up with the test cases.
https://github.com/gumballhead/datepicker/blob/master/src/it...