klipspringr / wordle-cli

Play Wordle on the command line.
37 stars 13 forks source link

'type' object is not subscriptable #2

Closed aaronnewsome closed 2 years ago

aaronnewsome commented 2 years ago

I followed the instructions for running this but I'm not able to. I'm using Python 3.8.10. When I clone the repo and run play.py, here's what I get:

$ ./play.py 
Traceback (most recent call last):
  File "./play.py", line 4, in <module>
    import wordle
  File "/home/anewsome/Desktop/1014-7555/wordle-cli/wordle.py", line 12, in <module>
    class Game:
  File "/home/anewsome/Desktop/1014-7555/wordle-cli/wordle.py", line 67, in Game
    def check_guess(guess: str, solution: str) -> list[LetterStates]:
TypeError: 'type' object is not subscriptable

I opened up the file to see if I could figure out what's really going on but I'm unable to figure it out. If anyone has a workaround, please post it!

klipspringr commented 2 years ago

Thanks for the report, Aaron. It turns out the particular kind of type hinting used in that line was only introduced in Python 3.9. It should be a straightforward fix, I'll get something released shortly.

Annoyingly, I used a tool which detects the minimum required Python version and it reported 3.6 -- but it obviously missed this.

aaronnewsome commented 2 years ago

Thanks for looking into it. I was able to spin up a Windows VM with python 3.9 and it works as expected. Thanks for creating this, and the game play is great! I'm going to try a new Linux VM and try to get it running over an SSH connection.

klipspringr commented 2 years ago

I've pushed an updated version - tested this using Python 3.6.0 and it appears resolved. Let me know if you have any further problems!