St.write() with text in [' '] behaves weird

Sometimes it shows up, while sometimes it doesn’t. Please refer to following code:

import streamlit as st

dt = "CLASS"
dt_id = 10
bl_id = 20
st.write(f"Subdata {dt}[{dt_id}]['whatever'][{bl_id}]")
st.write(f"Can you see ['me']?")

What is shown on webpage is:

Subdata CLASS[10][20]

Can you see ['me']?

Notice ‘whatever’ in first st.write() is not shown up, while ‘me’ in next line is shown up. By inspection in Chrome browser, it is <p>Subdata CLASS[10][20]</p>.

Environment: MacOS 10.15.5, anaconda+python 3.7.7, Streamlit v0.62.0

Wow, that’s really weird:

It’s solved by adding a \ in front of the bracket, but I can’t figure out why that would be an issue in the first place.

My guess would be something to do with reference style links in markdown which are two sets of square brackets.