狮身人面像和TypedDict

问题描述

我在代码中定义了一个TypedDict,如下所示:

class VectorDict(TypedDict):   
    x: float
    y: float
    z: float

当我生成文档时,得到以下结果:

enter image description here

如何隐藏->之后的所有内容和/或对其进行修改?

解决方法

解决方案是添加文档字符串:

class VectorDict(TypedDict):   
    """
    Description here
    """

    x: float
    y: float
    z: float

由此我获得:

enter image description here

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...