Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports for datetime.timedelta #13

Closed
sqlalchemy-bot opened this issue Dec 10, 2012 · 7 comments
Closed

Supports for datetime.timedelta #13

sqlalchemy-bot opened this issue Dec 10, 2012 · 7 comments

Comments

@sqlalchemy-bot
Copy link

Migrated issue, originally created by Antoine Bertin (diaoul)

Because that's user friendly

import datetime
from dogpile.cache import make_region

region = make_region().configure(
    'dogpile.cache.pylibmc',
    expiration_time = datetime.timedelta(hours=1),
    arguments = {
        'url':["127.0.0.1"],
    }
)

What do you think?

@sqlalchemy-bot
Copy link
Author

Changes by Antoine Bertin (diaoul):

  • edited description

@sqlalchemy-bot
Copy link
Author

Michael Bayer (zzzeek) wrote:

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

@sqlalchemy-bot
Copy link
Author

Antoine Bertin (diaoul) wrote:

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

@sqlalchemy-bot
Copy link
Author

Michael Bayer (zzzeek) wrote:

good point

@sqlalchemy-bot
Copy link
Author

Michael Bayer (zzzeek) wrote:

pull request here would be very helpful

@sqlalchemy-bot
Copy link
Author

Michael Bayer (zzzeek) wrote:

44a16a1 84aae5e

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (zzzeek):

  • changed status to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant