I got "args" from argparse:
args = parser.parse_args()
I want to pass it to two different functions with slight modifications each. That's why I want to deep copy the args, modify the copy and pass them to each function.
However, the copy.deepcopy just doesn't work. It gives me:
TypeError: cannot deepcopy this pattern object
So what's the right way to do it? Thanks
copy.deepcopy
seems to work fine on an emptyargparse.Namespace
in python 2.7.10 (and 3.6.0a2) ... Are you sure it's theNamespace
that is an issue and not the contents of the namespace? – Indiscrimination