Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 VSCode中的python智能感知_Python 2.7_Visual Studio Code - Fatal编程技术网

Python 2.7 VSCode中的python智能感知

Python 2.7 VSCode中的python智能感知,python-2.7,visual-studio-code,Python 2.7,Visual Studio Code,如果我有一个python类,其静态方法定义如下: @staticmethod def create(Name, parent_property, Description='', Source='', TrueMessage='True', FalseMessage='False'): """Simple method for creating Connector.Tags.DiscreteTag items using passed in values.""" named_val

如果我有一个python类,其静态方法定义如下:

@staticmethod
def create(Name, parent_property, Description='', Source='', TrueMessage='True', FalseMessage='False'):
    """Simple method for creating Connector.Tags.DiscreteTag items using passed in values."""
    named_value_bag = NamedValueBag()
    if Description:
        named_value_bag.Add('Description', Description)
    if Source:
        named_value_bag.Add('Source', Source)
    if TrueMessage:
        named_value_bag.Add('TrueMessage', TrueMessage)
    if FalseMessage:
        named_value_bag.Add('FalseMessage', FalseMessage)
    try:
        return DiscreteTag(Item.CreateInstance(DiscreteTag.__item_type, Name, named_value_bag, parent_property))
    except Exception, e:
        raise e
Intellisense工作正常,并向我显示了所有必需参数和关键字参数

但是,如果我尝试使其更通用(我通过模板和其他参数生成类,据我所知,这实际上是一个类方法),并定义如下方法:

@classmethod
def create(cls, Name, parent_property, Description='', Source='', TrueMessage='True', FalseMessage='False'):
    """Simple method for creating Connector.Tags.DiscreteTag items using passed in values."""
    named_value_bag = NamedValueBag()
    if Description:
        named_value_bag.Add('Description', Description)
    if Source:
        named_value_bag.Add('Source', Source)
    if TrueMessage:
        named_value_bag.Add('TrueMessage', TrueMessage)
    if FalseMessage:
        named_value_bag.Add('FalseMessage', FalseMessage)
    try:
        return cls(Item.CreateInstance(cls.__item_type, Name, named_value_bag, parent_property))
    except Exception, e:
        raise e
然后intellisense只向我显示MyClass.create(*args,**kwargs),我将丢失实际的参数名

这是VSCode的问题,还是我如何定义我的方法?我正在包装一个第三方API,我正在使用Python2.7,因为它最终是在IronPython上下文中执行的。我只想使用VSCode在中进行开发,并获得intellisense、语法突出显示、pylint等