I create a small wrapper module for a public library, there are a lot of repetitions in the library, where after creating the object, perhaps the methods require the same data elements.
I need to pass the same data in my wrapper class, but I don’t really want to pass the same thing over and over again. Therefore, I would like to save the data in my wrapper class and apply it if it is not included in this method. However, if something goes along the road, I want the method arguments to overwrite the standard defaults. Here is a code snippet that illustrates my goals.
class Stackoverflow(): def __init__(self,**kwargs): self.gen_args = {}
EDIT:
So the question is, how do I fix gen_args or is there a better way to do this? The specific error I get with this code is: return fn (* args, ** kwargs) TypeError: do_stuff () missing 1 required positional argument: 'self'
source share