Python pydev中多个参数的类型提示
因此,我需要pydev中的某种类型提示,并发现: 这是一种魅力 但是如果我有这样的东西: 类别MyClass:Python pydev中多个参数的类型提示,python,python-2.7,pydev,type-hinting,Python,Python 2.7,Pydev,Type Hinting,因此,我需要pydev中的某种类型提示,并发现: 这是一种魅力 但是如果我有这样的东西: 类别MyClass: def method(self, a, b): ':type a: ClassA' 如何获取这两个参数的类型提示? 我试过各种各样的组合 ':type a,b: ClassA, ClassB 或 或 有什么建议吗?或者甚至可能吗?我注意到它适用于以下格式: class MyClass: def method(self, a, b): #: :typ
def method(self, a, b):
':type a: ClassA'
如何获取这两个参数的类型提示?
我试过各种各样的组合
':type a,b: ClassA, ClassB
或
或
有什么建议吗?或者甚至可能吗?我注意到它适用于以下格式:
class MyClass:
def method(self, a, b):
#: :type a: ClassA
#: :type b: ClassB
如果你问我的话,它也更可读一些。我只把Python作为一种爱好做了大约一周,所以不要相信我的话
这种格式的优点在于它适用于几乎所有的类型暗示(PyDev手册中的示例):
或
美好的谢谢很好用!
':type a, ClassA'
':type b, ClassB'
':type a, ClassA, b, ClassB'
class MyClass:
def method(self, a, b):
#: :type a: ClassA
#: :type b: ClassB
class MyClass:
def method(self, lst):
#Can be on the same line
for a in lst: #: :type a: GUITest
a.;
class MyClass:
def method(self, lst):
#Or on the line before
#: :type a: GUITest
for a in lst:
a.;