MCPcopy Create free account
hub / github.com/requests-cache/requests-cache / BaseResponse

Class BaseResponse

requests_cache/models/response.py:29–45  ·  view source on GitHub ↗

Wrapper class for responses returned by :py:class:`.CachedSession`. This mainly exists to provide type hints for extra cache-related attributes that are added to non-cached responses.

Source from the content-addressed store, hash-verified

27
28@define(auto_attribs=False, repr=False, slots=False)
29class BaseResponse(Response):
30 """Wrapper class for responses returned by :py:class:`.CachedSession`. This mainly exists to
31 provide type hints for extra cache-related attributes that are added to non-cached responses.
32 """
33
34 created_at: datetime = field(factory=utcnow)
35 expires: Optional[datetime] = field(default=None)
36 cache_key: str = '' # Not serialized; set by BaseCache.get_response()
37 revalidated: bool = False # Not serialized; set by CacheActions.update_revalidated_response()
38
39 @property
40 def from_cache(self) -> bool:
41 return False
42
43 @property
44 def is_expired(self) -> bool:
45 return False
46
47
48@define(auto_attribs=False, repr=False, slots=False, init=False)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…