Skip to content

Instantly share code, notes, and snippets.

@juliomfreitas
Created November 14, 2016 20:48
Show Gist options
  • Save juliomfreitas/c9980e034744328c5da957ffe8294424 to your computer and use it in GitHub Desktop.
Save juliomfreitas/c9980e034744328c5da957ffe8294424 to your computer and use it in GitHub Desktop.
class B():
pass
class A():
pass
classes_dict = {"A": A, "B": B}
def get_class(klass):
return classes_dict[klass]
minha_classe_dinamica = get_class("A")()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment