Python3:检查方法是否静态

Python3:检查方法是否静态,第1张

Python3:检查方法是否静态
class A:  def f(self):    return 'this is f'  @staticmethod  def g():    return 'this is g'print(type(A.__dict__['g']))print(type(A.g))<class 'staticmethod'><class 'function'>


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/4945578.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-13
下一篇2022-11-13

发表评论

登录后才能评论

评论列表(0条)

    保存