Cache parsing of command line specifications

Change option specification from dict to tuple for better performance
and immutability and better type checking.
This commit is contained in:
Kovid Goyal
2025-09-29 12:31:10 +05:30
parent 1252098016
commit d8b524c692
7 changed files with 130 additions and 125 deletions

View File

@@ -247,7 +247,7 @@ def clone_safe_launch_opts() -> Sequence[GoOption]:
ans = []
allowed = clone_safe_opts()
for o in go_options_for_seq(parse_option_spec(options_spec())[0]):
if o.obj_dict['name'] in allowed:
if o.obj_defn.name in allowed:
ans.append(o)
return tuple(ans)