【发布时间】:2017-05-29 15:12:18
【问题描述】:
words_pron_dict:str 上的冒号是什么意思?我在 python 2.7 上遇到语法错误。是蟒蛇3吗?我该如何使用它?
class TextToSpeech:
CHUNK = 1024
def __init__(self, words_pron_dict:str = 'cmudict-0.7b.txt'):
self._l = {}
self._load_words(words_pron_dict)
【问题讨论】:
-
只需删除
:str,它就可以在python 2中工作(这是python 3.5的一个新功能来检查类型)
标签: python