Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created May 7, 2023 09:53
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 stephengruppetta/789457798e10a221d6cdd9f2d635a06b to your computer and use it in GitHub Desktop.
Save stephengruppetta/789457798e10a221d6cdd9f2d635a06b to your computer and use it in GitHub Desktop.
import functools
class Article:
def set_platform(self, platform):
self.platform = platform
# This still won't work! We'll fix it soon
set_substack = functools.partial(
set_platform,
platform='substack',
)
article = Article()
article.set_substack()
print(article.platform)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment