Summary
Can’t use st.session_state values of a range slider.
Documentation does not mention this point.
Steps to reproduce
Code snippet:
values = st.slider(
'Select a range of values',
0.0, 100.0, (25.0, 75.0), key=myvalues)
st.write(values)
st.write(st.session_state.myvalues)
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
Expected behavior:
IMHO, for consistency with other widgets, both st.write should return the same output.
Actual behavior:
st.session_state returns some kind of collection (<class ‘method’>) when working with range sliders. The documentation is not clear about this and does not mention how convert to a tuple or list.
Debug info
- Streamlit, version 1.14.1
- Python 3.10.8
- Not Using Conda! No PipEnv! No PyEnv! No Pex!
- OS version: Win 11
- Browser version: Chorme v107.0.5304.107