Created
August 31, 2018 22:09
-
-
Save rotaliator/d80a0724c050c646f8b715b5bd2fe179 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _get_class(class_name): | |
parts = class_name.split(".") | |
module = ".".join(parts[:-1]) | |
m = __import__(module) | |
for comp in parts[1:]: | |
m = getattr(m, comp) | |
return m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment