How to get arguments for 2 different objects from the command line when there is a naming conflict in Python argparse -
i have 2 classes, , b, each have own argument parser defined (using argparse) want add functionality a, calls class b. doing using composition (i.e has instance of object b) i asked here how combine 2 arg parse objects, argparsea include arguments in argparseb in question can 2 python argparse objects combined? problem follows: both , b have arguments same names. but- need 2 different values entered user (ie. argpasea.val1 needs values argparsea.val1 , argparseb.val1) (the obvious solution renaming val1 in either argparsea or argpaseb, there on 50 scripts inherit class a, , 50 scripts inherit class b, want changes , b minimal possible.) i thought of adding new , differently named argument argpasea called val2, can passed argparseb val1. my question is- proper way of doing such conversion or arguments argparsea argparseb? or there better way design this? i'm going guess trying parents suggestion, , illustrate might going on. if you've adopted approach m...