Efficient counting of results

Chris Angelico rosuav at gmail.com
Thu Oct 19 22:32:12 EDT 2017


On Fri, Oct 20, 2017 at 12:18 PM, Steve D'Aprano
<steve+python at pearwood.info> wrote:
> On Fri, 20 Oct 2017 05:28 am, Israel Brewster wrote:
>> So if the date of
>> the first record was today, t1 was on-time, and t2 was 5 minutes late, then
>> I would need to increment ALL of the following (using your data structure
>> from above):
>>
>> d10, w10, m10, y10, d25, w25, m25 AND y25
>
> Try using descriptive variable names rather than these cryptic codes.
>
> I don't understand what is *actually* being computed here -- you say that t1
> is "on time" and t2 is "5 minutes late", but that's a contradiction: how can
> a single record be both on time and 5 minutes late?

t1 and t2 are independent actions/timepoints, AIUI. So t1 could be the
time the order was put into the oven, and t2 is the time it got
delivered to the person's door. I'm assuming, here, that this database
records pizzas, because why not. An order could have been compiled and
put into the oven on time, but still delivered late; or it could be
ovened slightly late, but thanks to the new high-speed delivery
drones, it was actually at the customer's doorstep on time.

ChrisA



More information about the Python-list mailing list