-
-
Save satishgoda/6139a9d3c0fb76687b4bb837c7ec7328 to your computer and use it in GitHub Desktop.
dynamic return func
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
class A(object): | |
def __init__(self): | |
self.var1 = None | |
self.var2 = None | |
class B(object): | |
def __init__(self): | |
self.var3 = None | |
self.var4 = None | |
def factory(myCls,*args,**kwargs): | |
return myCls(*args,**kwargs) | |
obj = factory(A) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment