from werkzeug.datastructures import ResponseCacheControl
cc = ResponseCacheControl()
cc.s_maxage = 1
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Input In [13], in <cell line: 1>()
----> 1 cc.s_maxage = 1
File /usr/local/lib/python3.10/site-packages/werkzeug/datastructures.py:1958, in cache_control_property.<locals>.<lambda>(x, v)
1949 def cache_control_property(key, empty, type):
1950 """Return a new property object for a cache header. Useful if you
1951 want to add support for a cache extension in a subclass.
1952
1953 .. versionchanged:: 2.0
1954 Renamed from ``cache_property``.
1955 """
1956 return property(
1957 lambda x: x._get_cache_value(key, empty, type),
-> 1958 lambda x, v: x._set_cache_value(key, v, type),
1959 lambda x: x._del_cache_value(key),
1960 f"accessor for {key!r}",
1961 )
File /usr/local/lib/python3.10/site-packages/werkzeug/datastructures.py:2039, in _CacheControl._set_cache_value(self, key, value, type)
2037 self[key] = None
2038 else:
-> 2039 self[key] = type(value)
TypeError: 'NoneType' object is not callable
from flask import Response
response = Response()
response.cache_control.s_maxage = 1
Response().cache_control.s_maxageerrors withNoneis not callable2.0.3 is OK
Flask use case
Environment: