def copy_code(code_obj, **kwargs):
    "Make a copy of a code object, maybe changing some attributes"
    for arg in code_args:
        if not kwargs.has_key(arg):
            kwargs[arg] = getattr(code_obj, 'co_%s' % arg) 
    return CodeType(*map(kwargs.__getitem__, code_args))
Make a copy of a code object, maybe changing some attributes
recipes/Python/521874_Functions_positional_only/recipe-521874.py