内建方法
dir(__builtins__)
类和实例方法对比
class person:
def __init__(self, job):
self.job = job
name = "mao"
def show(self):
print('hello mao')
- 打印类的属性和方法
for i in dir(person):
print(i)
- 打印对象的属性和方法
# p = person('it')
# for i in dir(p):
# print(i)
原文地址:https://www.cnblogs.com/iiiiiher/p/8287420.html
时间: 2024-10-08 09:45:50