Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the colon inside the parameter mean? [duplicate]

Tags:

python

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)
like image 805
rap sea Avatar asked Jan 14 '17 08:01

rap sea


1 Answers

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

You should be able to just remove it.

like image 147
Lucero Avatar answered Oct 14 '22 23:10

Lucero