Skip to content

Instantly share code, notes, and snippets.

@DalyaG
Created January 7, 2021 11:32
Show Gist options
  • Save DalyaG/36edb84f0edc5a485deaa9ec563b87d9 to your computer and use it in GitHub Desktop.
Save DalyaG/36edb84f0edc5a485deaa9ec563b87d9 to your computer and use it in GitHub Desktop.
# When you want to add a new parameter, you only need to add in 2 places:
# In params.py:
class Params:
...
my_new_param: float = 42
# At the "end-point" where this parameter is used:
class VeryDeepModule:
...
def very_deep_method(self):
do_something(self.params.my_new_param)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment