I discovered something tonight that will be helpful here: We can unwrap magic staticmethod
and classmethod
objects via: getattr(func, '__func__')
How did I find this information? Using JetBrains' PyCharm (I don't know about other Python IDEs), I viewed the source code for @staticmethod
and @classmethod
. Both classes define the attribute __func__
.
"The rest is left as an exercise for the reader."