Hacker News new | ask | show | jobs
by coleifer 2575 days ago
I'd rather have a sane API.

    def configure_ring():
        if DEBUG:
            return Ring(backend='debug')
        else:
            return Ring(backend='memcache', ...)

    ring = configure_ring()
    
    @ring.cache(expire=60)
    def get_url(...):
        ...
Tons of other libraries out there that implement this exact pattern.
1 comments

agree