streamlit / docs

Source code for the Streamlit Python library documentation
https://docs.streamlit.io
Apache License 2.0
119 stars 474 forks source link

Typo in example code #1037

Closed Ste1io closed 6 months ago

Ste1io commented 6 months ago

This doesn't work due to args being a tuple:

https://github.com/streamlit/docs/blob/6641c367cc7f9e41f9639086045b120e5f5c2c16/content/develop/concepts/architecture/widget-behavior.md?plain=1#L171-L172

Should be ("my_key",).

Asaurus1 commented 6 months ago

Yep this is a typo

Ste1io commented 6 months ago

I can open a PR with the fix.

Ste1io commented 6 months ago

On a somewhat different note, but regarding the same code block in terms of correctness and code clarity, wouldn't more appropriate names be load_value and store_value? This more accurately describes the transient operation being performed, which is more akin to loading and storing register values in assembly.

Notably, the term "get" in function names implies a return value, which is not the case here; it's simply loading the permanent key's value into a transient key.

sfc-gh-dmatthews commented 6 months ago

@Ste1io, good comment. I'll add that to the commit.