Skip to content

Commit a6d283d

Browse files
authored
Fix big inefficiency in shtab optionals as positionals support (#703)
1 parent 1a097bf commit a6d283d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jsonargparse/_completions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from collections import defaultdict
77
from contextlib import contextmanager, suppress
88
from contextvars import ContextVar
9-
from copy import deepcopy
9+
from copy import copy
1010
from enum import Enum
1111
from importlib.util import find_spec
1212
from subprocess import PIPE, Popen
@@ -133,7 +133,7 @@ def shtab_prepare_actions(parser) -> None:
133133
shtab_prepare_actions(subparser)
134134
if get_parsing_setting("parse_optionals_as_positionals"):
135135
for action in get_optionals_as_positionals_actions(parser):
136-
clone = deepcopy(action)
136+
clone = copy(action)
137137
clone.option_strings = []
138138
clone.nargs = "?"
139139
parser._actions.append(clone)

0 commit comments

Comments
 (0)