You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parser decorators on functools.wraps wrappers mutate the original function #728
Decorating a functools.wraps wrapper with SetParseFns also changes how the original function parses arguments. wraps copies the wrapped function's attribute dictionary, so the nested Fire metadata dictionaries are shared. SetParseFns updates those dictionaries in place.
Reproduced using complete current master 716bbc23d7eca949fdb682172283c8d18f742cb6 on Linux/Python 3.14:
The wrapper's parser should not silently replace the original function's parser. This is observable through fire.Fire, without mocking argument parsing or copying implementation fragments.
I intend to investigate a focused copy-on-write fix for the metadata owned by the parser decorators, with regression tests covering named, positional and default parsers. This does not propose changing Fire's wrapper-signature handling. I searched open and closed issues/PRs for metadata, wrappers, decorator copying and SetParseFns and found no exact covering change. No repair PR is open yet; full-suite qualification is still pending.
Activity