如果我使用非常简单的python文件:
def magic_function(parameter1):
"""
Do magic with parameter1.
:param parameter1: The first of all paramters
:type parameter1: nd_array
"""
return parameter1
我在参数后面得到类型:
如果我现在和拿破仑一起使用numpy风格:
def magic_function(parameter1):
"""
Do magic with parameter1.
Parameters
==========
parameter1: nd_array
The first of all paramters
"""
return parameter1
我的结局是这样的
问题似乎是nd_array
不是一个有效的类型,这对于默认的斯芬克斯来说似乎不是一个问题,但是对于拿破仑来说这似乎很重要,例如类型int
工作得很完美。你知道吗
我不确定下面的方法是否适用于
nd_array
,但我假设它应该适用于内置类型(str
、list
、float
,等等)。下面是一个对我有用的小例子:输出:
相关问题 更多 >
编程相关推荐