Skip to content

Fix mutable arguments passed as default arguments.#101

Open
roberthdevries wants to merge 1 commit intowolfSSL:masterfrom
roberthdevries:fix-passing-mutable-argument-as-default
Open

Fix mutable arguments passed as default arguments.#101
roberthdevries wants to merge 1 commit intowolfSSL:masterfrom
roberthdevries:fix-passing-mutable-argument-as-default

Conversation

@roberthdevries
Copy link
Copy Markdown
Contributor

Function defaults are evaluated once, when the function is defined.

The same mutable object is then shared across all calls to the function. If the object is modified, those modifications will persist across calls, which can lead to unexpected behavior.

Function defaults are evaluated once, when the function is defined.

The same mutable object is then shared across all calls to the function.
If the object is modified, those modifications will persist across calls,
which can lead to unexpected behavior.
@roberthdevries roberthdevries force-pushed the fix-passing-mutable-argument-as-default branch from ee90b05 to 786dd94 Compare April 11, 2026 16:55
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