Supports for datetime.timedelta

Issue #13 resolved
Antoine Bertin
created an issue

Because that's user friendly

import datetime
from dogpile.cache import make_region

region = make_region().configure(
    expiration_time = datetime.timedelta(hours=1),
    arguments = {

What do you think?

Comments (6)

  1. Michael Bayer repo owner

    OK, I'd be surprised if people go through the trouble to import when they can just multiply out the number of seconds, but sure this is just an isinstance check

  2. Antoine Bertin reporter

    For the sake of readability when duration is not a round number or if the expiration is long enough to make use of other arguments of timedelta. And that's pythonic

  3. Log in to comment