标签: epytext

如何使用 epytext 记录 kwargs 以在 PyCharm 中自动完成提示?

是否可以获得 kwargs 的额外提示,这将为您提供预定义的可能关键字参数的示例?也许epytext不支持它?

class Person():
    def __init__(self, **kwargs):
        """
        @param name: Name
        @type name: str
        @param age: Age
        @type age: int
        @param connections: Connections to other persons
        @type connections: [Person]
        .
        .
        . # I know this is not working
        """
        self.name = kwargs[name] if name in kwargs
        self.age  = kwargs[age] if age in kwargs
        # and so on ...
Run Code Online (Sandbox Code Playgroud)

如果我能在完成提示中得到这样的东西(对不起,我不得不删除图片),那就太好了:

  • > 自我、姓名、年龄、人脉

一个 Quick Doku 看起来像这样:

  • 没有图像*

我真的很喜欢将通用课程作为父母的全球课程。这使得重用更容易。所以这是一个小片段示例:

class common():
    PERSON_DETAILS = dict( name       = ' ',
                           age        = …
Run Code Online (Sandbox Code Playgroud)

python docstring pycharm keyword-argument epytext

6
推荐指数
1
解决办法
2652
查看次数

标签 统计

docstring ×1

epytext ×1

keyword-argument ×1

pycharm ×1

python ×1