adriangalilea / streamlit-shortcuts

Streamlit keyboard shortcuts for your buttons.
MIT License
21 stars 4 forks source link

type-hinting fix to allow python3.8 compatibility #11

Closed abhijitmajumdar closed 2 months ago

abhijitmajumdar commented 2 months ago

Subscripting type hints was introduced in python 3.9+. This change enables use of streamlit-shortcuts with python 3.8 as well!

ref: https://docs.python.org/3.9/whatsnew/3.9.html#type-hinting-generics-in-standard-collections

Relevant error log in python 3.8:

    def add_keyboard_shortcuts(key_combinations: dict[str, str]):
TypeError: 'type' object is not subscriptable

Why (still) python 3.8?

adriangalilea commented 1 month ago

@abhijitmajumdar apologies for the butchering of the correct history, I tried making it right so it showed you as an author but couldn't make it perfect and the release doesn't detect the right PR so I manually wrote the release notes.

Otherwise your changes are live on 0.1.4