Skip to content

Caching does not work with default args #19

@Kemaweyan

Description

@Kemaweyan

This code does not work

import requests

dns_cache.override_system_resolver()

for i in range(10):
     requests.get('http://www.coala.io/')

It does not speed up requests but makes them even slowly. Looking into the library code I found that the get method is being called for the dns_cache.hosts.HostsCache object, but the put method calls - for dns_cache.expiration.MinExpirationCache. Of course, it could cache nothing because the self.data dicts are different and the get method could not find items stored in the put method of another object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions