35

What does the colon on words_pron_dict:str mean? I am getting syntax error on python 2.7. Is it python 3? How can i use it?

class TextToSpeech:
    CHUNK = 1024

    def __init__(self, words_pron_dict:str = 'cmudict-0.7b.txt'):
        self._l = {}
        self._load_words(words_pron_dict)
Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
rap sea
  • 463
  • 1
  • 5
  • 8

1 Answers1

28

It's a type annotation: https://docs.python.org/3/library/typing.html

You should be able to just remove it.

Lucero
  • 59,176
  • 9
  • 122
  • 152