使用Python 3的函数注释,可以指定同构列表(或其他集合)中包含的项的类型,以便在PyCharm和其他IDE中进行类型提示?
int列表的伪python代码示例:
def my_func(l:list<int>): pass
我知道使用Docstring是可能的。。。
def my_func(l): """ :type l: list[int] """ pass
…但如果可能的话,我更喜欢注释样式。