python - ¿Qué significa el colon dentro del parámetro?
(1)
Esta pregunta ya tiene una respuesta aquí:
- ¿Cuáles son las sugerencias de tipo en Python 3.5 3 respuestas
¿Qué significa el colon en words_pron_dict: str? Recibo un error de sintaxis en Python 2.7. ¿Es Python 3? como puedo usar lo?
class TextToSpeech:
CHUNK = 1024
def __init__(self, words_pron_dict:str = ''cmudict-0.7b.txt''):
self._l = {}
self._load_words(words_pron_dict)
Es una anotación de tipo: https://docs.python.org/3/library/typing.html
Deberías poder eliminarlo.