test: fix default value for additional param by thefourtheye · Pull Request #2553 · nodejs/node

@thefourtheye

In Python, the default values of parameters are evaluated only once
during their declaration. So, whenever the default parameter is used
the same object will be used. Since we use a list, which is a mutable
object, this could lead to unexpected results.

@thefourtheye added the test

Issues and PRs related to the tests.

label

Aug 26, 2015

thefourtheye added a commit that referenced this pull request

Sep 15, 2015
In Python, the default values of parameters are evaluated only once
during their declaration. So, whenever the default parameter is used
the same object will be used. Since we use a list, which is a mutable
object, this could lead to unexpected results.

PR-URL: #2553
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

thefourtheye added a commit that referenced this pull request

Sep 15, 2015
In Python, the default values of parameters are evaluated only once
during their declaration. So, whenever the default parameter is used
the same object will be used. Since we use a list, which is a mutable
object, this could lead to unexpected results.

PR-URL: #2553
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

@rvagg rvagg mentioned this pull request

Sep 22, 2015

@erdun erdun mentioned this pull request

May 14, 2022

@s4sc s4sc mentioned this pull request

May 14, 2022

This was referenced

Sep 26, 2022

@s4sc s4sc mentioned this pull request

Nov 28, 2023