streamlit-nightly 1.36.1.dev20240723__py2.py3-none-any.whl → 1.36.1.dev20240724__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/runtime/caching/cache_utils.py +25 -11
- {streamlit_nightly-1.36.1.dev20240723.dist-info → streamlit_nightly-1.36.1.dev20240724.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.36.1.dev20240723.dist-info → streamlit_nightly-1.36.1.dev20240724.dist-info}/RECORD +7 -7
- {streamlit_nightly-1.36.1.dev20240723.data → streamlit_nightly-1.36.1.dev20240724.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.36.1.dev20240723.dist-info → streamlit_nightly-1.36.1.dev20240724.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.36.1.dev20240723.dist-info → streamlit_nightly-1.36.1.dev20240724.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.36.1.dev20240723.dist-info → streamlit_nightly-1.36.1.dev20240724.dist-info}/top_level.txt +0 -0
@@ -157,21 +157,25 @@ def make_cached_func_wrapper(info: CachedFuncInfo) -> Callable[..., Any]:
|
|
157
157
|
some or all of the wrapper's cached values.
|
158
158
|
"""
|
159
159
|
cached_func = CachedFunc(info)
|
160
|
+
return functools.update_wrapper(cached_func, info.func)
|
160
161
|
|
161
|
-
# We'd like to simply return `cached_func`, which is already a Callable.
|
162
|
-
# But using `functools.update_wrapper` on the CachedFunc instance
|
163
|
-
# itself results in errors when our caching decorators are used to decorate
|
164
|
-
# member functions. (See https://github.com/streamlit/streamlit/issues/6109)
|
165
162
|
|
166
|
-
|
167
|
-
|
168
|
-
|
163
|
+
class BoundCachedFunc:
|
164
|
+
"""A wrapper around a CachedFunc that binds it to a specific instance in case of
|
165
|
+
decorated function is a class method."""
|
169
166
|
|
170
|
-
|
171
|
-
|
172
|
-
|
167
|
+
def __init__(self, cached_func: CachedFunc, instance: Any):
|
168
|
+
self._cached_func = cached_func
|
169
|
+
self._instance = instance
|
173
170
|
|
174
|
-
|
171
|
+
def __call__(self, *args, **kwargs) -> Any:
|
172
|
+
return self._cached_func(self._instance, *args, **kwargs)
|
173
|
+
|
174
|
+
def __repr__(self):
|
175
|
+
return f"<BoundCachedFunc: {self._cached_func._info.func} of {self._instance}>"
|
176
|
+
|
177
|
+
def clear(self, *args, **kwargs):
|
178
|
+
self._cached_func.clear(self._instance, *args, **kwargs)
|
175
179
|
|
176
180
|
|
177
181
|
class CachedFunc:
|
@@ -179,6 +183,16 @@ class CachedFunc:
|
|
179
183
|
self._info = info
|
180
184
|
self._function_key = _make_function_key(info.cache_type, info.func)
|
181
185
|
|
186
|
+
def __repr__(self):
|
187
|
+
return f"<CachedFunc: {self._info.func}>"
|
188
|
+
|
189
|
+
def __get__(self, instance, owner=None):
|
190
|
+
"""CachedFunc implements descriptor protocol to support cache methods."""
|
191
|
+
if instance is None:
|
192
|
+
return self
|
193
|
+
|
194
|
+
return functools.update_wrapper(BoundCachedFunc(self, instance), self)
|
195
|
+
|
182
196
|
def __call__(self, *args, **kwargs) -> Any:
|
183
197
|
"""The wrapper. We'll only call our underlying function on a cache miss."""
|
184
198
|
|
@@ -319,7 +319,7 @@ streamlit/runtime/caching/cache_data_api.py,sha256=dodSmj-Zpp2GnfFFBNyP6YgkTHdLy
|
|
319
319
|
streamlit/runtime/caching/cache_errors.py,sha256=0yMPp7XhePilU91rIYu_XEuKnv6qeixW5a_YirpHWS8,4760
|
320
320
|
streamlit/runtime/caching/cache_resource_api.py,sha256=dD4wYxwggVegL4iLZWZShZn6X8TDNLmU8CShpsFX8s8,20975
|
321
321
|
streamlit/runtime/caching/cache_type.py,sha256=P21JWouFWU0qXQyHbM3y3A1pLZud90ALGeO4bQ5Pvew,1131
|
322
|
-
streamlit/runtime/caching/cache_utils.py,sha256=
|
322
|
+
streamlit/runtime/caching/cache_utils.py,sha256=a36_4CWezuCR4okG7CHOaVWszImKmZq8XVre8IZMfsY,18673
|
323
323
|
streamlit/runtime/caching/cached_message_replay.py,sha256=20lsH6isxIr6Mpixywj-_I6ltFDD_NX4MnmWia4LRVA,17973
|
324
324
|
streamlit/runtime/caching/hashing.py,sha256=05cvu9x_KV2pQp8pisH_mTIL0pqbBhobf3HZWVpNT6w,18988
|
325
325
|
streamlit/runtime/caching/legacy_cache_api.py,sha256=Jw1JoQeYN-A7Fjn7KJmq8dy0oFuBX6WtUXNqO0KsSdg,6033
|
@@ -536,9 +536,9 @@ streamlit/web/server/server_util.py,sha256=C3M971XFoEXTMufQLwHbZdtZOE30nWx-2WiXm
|
|
536
536
|
streamlit/web/server/stats_request_handler.py,sha256=47nQHe4ETsO9QS9FAEUF8rZigU_k5eACJZw4-jc8U6c,3684
|
537
537
|
streamlit/web/server/upload_file_request_handler.py,sha256=ftyKpARrUjOpRcFETIXuoTyOG_mo-ToOw5NI0y_W4lE,5003
|
538
538
|
streamlit/web/server/websocket_headers.py,sha256=xkmLm7-WyXyQM8fW-NuURBnD_rmQaiO3oBlu6woF71w,2207
|
539
|
-
streamlit_nightly-1.36.1.
|
540
|
-
streamlit_nightly-1.36.1.
|
541
|
-
streamlit_nightly-1.36.1.
|
542
|
-
streamlit_nightly-1.36.1.
|
543
|
-
streamlit_nightly-1.36.1.
|
544
|
-
streamlit_nightly-1.36.1.
|
539
|
+
streamlit_nightly-1.36.1.dev20240724.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
|
540
|
+
streamlit_nightly-1.36.1.dev20240724.dist-info/METADATA,sha256=OmqrsMmpEZrL0eJw7nFhsViweOFH2ep4eqLYJFvIt9I,8531
|
541
|
+
streamlit_nightly-1.36.1.dev20240724.dist-info/WHEEL,sha256=ANi2y8tYx-p70pj7MSdqQMJNFJEUgAOyfPpHzqz0w84,109
|
542
|
+
streamlit_nightly-1.36.1.dev20240724.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
|
543
|
+
streamlit_nightly-1.36.1.dev20240724.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
|
544
|
+
streamlit_nightly-1.36.1.dev20240724.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|