(v)
| 40 | |
| 41 | |
| 42 | def getmodulename(v): |
| 43 | if isinstance(v, types.ModuleType): |
| 44 | return v.__name__ |
| 45 | if isinstance(v, types.MethodDescriptorType): |
| 46 | return getmodulename(v.__objclass__) |
| 47 | return getattr(v, "__module__", None) |
| 48 | |
| 49 | |
| 50 | @functools.singledispatch |