Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
As you were posting your answer, I edited the question. I am now doing getattr(args, key, []).append(v) and setattr(args, key, value). But, I will change to using extend, didn't think about that :) Is using setattr and getattr better than reaching into the args and pulling out the dict? The class and function are actually part of a bigger project, this code was to test if it works. Thanks for your help