(oclass, obj, name)
| 83 | dict = pyclbr.readmodule_ex(moduleName) |
| 84 | |
| 85 | def ismethod(oclass, obj, name): |
| 86 | classdict = oclass.__dict__ |
| 87 | if isinstance(obj, MethodType): |
| 88 | # could be a classmethod |
| 89 | if (not isinstance(classdict[name], ClassMethodType) or |
| 90 | obj.__self__ is not oclass): |
| 91 | return False |
| 92 | elif not isinstance(obj, FunctionType): |
| 93 | return False |
| 94 | |
| 95 | objname = obj.__name__ |
| 96 | if objname.startswith("__") and not objname.endswith("__"): |
| 97 | if stripped_typename := oclass.__name__.lstrip('_'): |
| 98 | objname = f"_{stripped_typename}{objname}" |
| 99 | return objname == name |
| 100 | |
| 101 | # Make sure the toplevel functions and classes are the same. |
| 102 | for name, value in dict.items(): |
no test coverage detected