参数中的冒号是什么意思?

2024-09-27 17:57:35 发布

您现在位置:Python中文网/ 问答频道 /正文

str上的冒号是什么意思?我在Python2.7上发现语法错误。是Python3吗?我怎么用?

class TextToSpeech:
    CHUNK = 1024

    def __init__(self, words_pron_dict:str = 'cmudict-0.7b.txt'):
        self._l = {}
        self._load_words(words_pron_dict)

Tags: selftxtinitdefdictpython3classwords

热门问题