您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. def list_all_mro_mthds(klass,mthd_name):
  2. ret = []
  3. called = set([None])
  4. for cls_obj in klass.__mro__:
  5. mthd = getattr(cls_obj,mthd_name,None)
  6. if not mthd in called:
  7. called.add(mthd)
  8. ret.append(mthd)
  9. return ret
  10. # assumes all methods of interest will be callable in decendant class
  11. def class_info(klass):
  12. mthds = {}
  13. cnt=0
  14. # mro =
  15. for en in dir(klass):
  16. if (en[:2]=="__"):continue
  17. attr = getattr(klass,en,None)
  18. if (not callable(attr)):continue
  19. # p(en,type(attr))
  20. # p(en,type(attr))
  21. # p(attr)
  22. m2 = list_all_mro_mthds(klass,en)
  23. # if (len(m2)>1):
  24. if 1:
  25. p(len(m2),en)
  26. for m in m2:
  27. # p("\t",m)
  28. p(" ",m)
  29. cnt+=1
  30. # p(len(klass.__mro__))
  31. # p(len(set(klass.__mro__)))
  32. # p(klass.__mro__)
  33. p(cnt)
  34. run_now()
  35. # p("/")
  36. # class_info(Mixins.DevMixin)
  37. # class_info(Mixins.DevRlist)
  38. # p(class_info)