Difference between two times (working ugly code, needs polish)

Shawn Milochik Shawn at Milochik.com
Wed Sep 12 06:42:09 EDT 2007


> Just to be picky - your function returns the number of days between
> two dates, but it's called isOld, which looks like it should return a
> boolean.  i.e.  it looks like it would be used as:
>
> if not isOld(auctionDate, currentTime):
>     checkForBid()
>
> rather than how I assume it is used:
>
> if isOld(auctionDate, currentTime) <= 10:
>     checkForBid()
>
> I'd call it daysDiff or something similar, or make it more specific so
> that it works like the first block of code above:

You're absolutely right; I started writing it with one purpose in mind
and changed it midstream. I actually renamed it yesterday to dayDiff.
;o)

Shawn



More information about the Python-list mailing list