Skip to content

Instantly share code, notes, and snippets.

@yyolk
Created August 10, 2018 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yyolk/c6b8311a5c0172687928311ebe6c0261 to your computer and use it in GitHub Desktop.
Save yyolk/c6b8311a5c0172687928311ebe6c0261 to your computer and use it in GitHub Desktop.
class Base():
def __init__(self, *a, **k):
exec( "self.{} = self._op".format(
kw.get('override_fn_name',
self.__class__.__name__.lower())))
def _op(self, *a, **k):
pass
class Extend(Base):
pass
c = Extend()
print(c.__dict__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment