【发布时间】:2019-11-13 10:39:04
【问题描述】:
我获得了 python 3.x 代码,但由于函数定义中的冒号,我的 python 2.7 解释器无法解释它。
我运行的代码:
def __init__(self, api_key: str, base_url: Tuple[str, None] = None):
我得到的错误:
File "C:\Users\3791108\Downloads\CloudClient.py", line 191
def __init__(self, api_key: str, base_url: Tuple[str, None] = None):
^
SyntaxError: unexpected token ':'
【问题讨论】:
-
不会说它是重复的。这个问题问
what,链接里的问题问why... -
这里有个问题问
what:stackoverflow.com/questions/41648300/…
标签: python python-3.x