相关疑难解决方法(0)

python:获取类变量和类型提示

假设我定义了一个带有类提示并带有类型提示的类(例如,类似于新的python 3.7数据类)

class Person:
    name: str
    age: int

    def parse_me(self):
        "what do I do here??"        
Run Code Online (Sandbox Code Playgroud)

我如何得到双(variable name, variable type)

python

3
推荐指数
2
解决办法
546
查看次数

标签 统计

python ×1