Skip to content

fix(components): replace mutable default arguments with safe alternatives#114

Merged
janickm merged 1 commit into
NVIDIA:mainfrom
janickm:dev/janickm/fix-mutable-defaults
May 15, 2026
Merged

fix(components): replace mutable default arguments with safe alternatives#114
janickm merged 1 commit into
NVIDIA:mainfrom
janickm:dev/janickm/fix-mutable-defaults

Conversation

@janickm
Copy link
Copy Markdown
Collaborator

@janickm janickm commented May 15, 2026

Summary

  • Fix 6 occurrences of mutable default arguments (Dict[...] = {}) in method signatures in components.py
  • Each is changed to Optional[Dict[...]] = None with a guard if param is None: param = {} at the top of the method body
  • Prevents the classic Python shared-state bug where all callers share the same dict instance

@janickm janickm self-assigned this May 15, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 15, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@janickm janickm force-pushed the dev/janickm/fix-mutable-defaults branch from c8dad76 to 9d2884d Compare May 15, 2026 09:49
@janickm
Copy link
Copy Markdown
Collaborator Author

janickm commented May 15, 2026

/ok to test 9d2884d

@janickm janickm force-pushed the dev/janickm/fix-mutable-defaults branch from 9d2884d to a67d986 Compare May 15, 2026 10:41
@janickm
Copy link
Copy Markdown
Collaborator Author

janickm commented May 15, 2026

/ok to test a67d986

@janickm janickm force-pushed the dev/janickm/fix-mutable-defaults branch from a67d986 to 3e8bad3 Compare May 15, 2026 11:10
@janickm janickm enabled auto-merge (rebase) May 15, 2026 11:13
@janickm janickm disabled auto-merge May 15, 2026 11:30
@janickm janickm merged commit 499b509 into NVIDIA:main May 15, 2026
5 checks passed
@janickm janickm deleted the dev/janickm/fix-mutable-defaults branch May 15, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant