-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
feature:cacheRelated to `st.cache_data` and `st.cache_resource`Related to `st.cache_data` and `st.cache_resource`type:bugSomething isn't working as expectedSomething isn't working as expected
Description
Summary
When trying to cache a function with an nested list comprehension, streamlit doesn't allow outer iterator value within inner iterator.
Steps to reproduce
import streamlit as st
@st.cache()
def create_raw_data():
production=[[outer + inner for inner in range(3)] for outer in range(5)]
return production
production = create_raw_data()
st.write(production)Expected behavior:
Should print [[0, 1, 2], [1, 2, 3], ..., [4, 5, 6]]
Actual behavior:
Is this a regression?
No.
Debug info
- Streamlit version: (get it with 0.70.0)
- Python version: (get it with 3.7.7)
- Using Conda? PipEnv? PyEnv? Pex? Using conda env. Streamlit Installed with pip
- OS version: Ubuntu 18.04
- Browser version: Chrome
Additional information
Same as #1801 but that issue was closed. The provided solution there doesn't work.
Metadata
Metadata
Assignees
Labels
feature:cacheRelated to `st.cache_data` and `st.cache_resource`Related to `st.cache_data` and `st.cache_resource`type:bugSomething isn't working as expectedSomething isn't working as expected
