Handle the iterator protocol properly in `st.cache`
See original GitHub issueSummary
As part of our December plan to fix hashing, we are defining new hashing semantics. This issue covers step 3.
More background
This task is important becuase:
- It means we no longer have to special case
list
s andtuple
s. - It is a prerequisite to enable hashing of other primitive types through default
hash_funcs
(INSERT LINK HERE). - It allows the user to recursively hash container types.
Details
Step 3 states that we handle iterators properly.
Roughly the semantics are:
try:
for elem in iter(x):
hash(elem)
except (this iter thing failed):
go onto step 4
Important Note: When this is done, we no longer need to special case list
s and tuple
s!
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Optimize performance with st.cache - Streamlit Docs
We're developing new cache primitives that are easier to use and much faster than @st.cache . To learn more, read Experimental cache primitives....
Read more >C++ and STL: Take Advantage of STL Algorithms by ...
In the iterator sample, I treat the cache as a read-only data structure in order to use several algorithms in the STL and...
Read more >Set-Associative Cache - an overview | ScienceDirect Topics
An N-way set associative cache reduces conflicts by providing N blocks in each set where data mapping to that set might be found....
Read more >Using Hot Rod Java clients - Infinispan
Hot Rod is a binary TCP client/server protocol that gives fast access ... Connect to the Infinispan cluster RemoteCacheManager cacheManager ...
Read more >Caching in GitLab CI/CD
A cache is one or more files a job downloads and saves. ... During the caching process, there's also a couple of things...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, we’ve made the following decision:
No. Not missing anything. Lemme think about this and get back to you!