class documentation

An Intersphinx cache.

Class Method fromParameters Construct an instance with the given parameters.
Method close Undocumented
Method get Retrieve a URL using the cache.
Instance Variable _session A session that may or may not cache requests.
@classmethod
def fromParameters(cls, sessionFactory: Callable[[], requests.Session], cachePath: str, maxAgeDictionary: Mapping[str, int]) -> IntersphinxCache: (source)

Construct an instance with the given parameters.

Parameters
sessionFactory:Callable[[], requests.Session]A zero-argument callable that returns a requests.Session.
cachePath:strPath of the cache directory.
maxAgeDictionary:Mapping[str, int]A mapping describing the maximum age of any cache entry.
Returns
IntersphinxCacheUndocumented
See Also
parseMaxAge
def close(self): (source)

Undocumented

def get(self, url: str) -> bytes | None: (source)

Retrieve a URL using the cache.

Parameters
url:strThe URL to retrieve.
Returns
bytes | NoneThe body of the URL, or None on failure.

A session that may or may not cache requests.