GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: fix default value for additional param by thefourtheye · Pull Request #2553 · nodejs/node

Conversation

@thefourtheye

@thefourtheye thefourtheye commented Aug 26, 2015

Copy link
Copy Markdown
Contributor

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.

cc @nodejs/build

CI Run: https://jenkins-iojs.nodesource.com/job/node-test-pull-request/169/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@thefourtheye
test: fix default value for additional param
7fc514a
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 thefourtheye added the test Issues and PRs related to Node.js core tests and test infrastructure. label Aug 26, 2015
@rmg

rmg commented Aug 27, 2015

Copy link
Copy Markdown
Contributor

LGTM 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis reviewed Aug 27, 2015
View reviewed changes
Comment thread test/testpy/__init__.py

@bnoordhuis bnoordhuis Aug 27, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could shorten this to self.additional_flags = additional or [].

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@thefourtheye thefourtheye Aug 27, 2015

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnoordhuis Correct but if an empty list is actually passed, we ll still ignore it and create a new list, if we do additional or [] . We don't want that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@thefourtheye thefourtheye Sep 10, 2015

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnoordhuis ping!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis

bnoordhuis commented Aug 27, 2015

Copy link
Copy Markdown
Member

LGTM with a suggestion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg
rvagg force-pushed the master branch from 11c25c2 to ba02bd0 Compare September 6, 2015 11:55
@bnoordhuis

bnoordhuis commented Sep 14, 2015

Copy link
Copy Markdown
Member

Just to confirm: LGTM. A suggestion means you're free to take it or leave it. :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thefourtheye added a commit that referenced this pull request Sep 15, 2015
@thefourtheye
test: fix default value for additional param
52f84ad
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 <[email protected]>
@thefourtheye

thefourtheye commented Sep 15, 2015

Copy link
Copy Markdown
Contributor Author

Thanks for the review Ben, landed in 52f84ad. I had changed, the super call of AddonTestConfiguration by passing additional to it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thefourtheye thefourtheye closed this Sep 15, 2015
@thefourtheye
thefourtheye deleted the test_py_fix branch September 15, 2015 14:36
thefourtheye added a commit that referenced this pull request Sep 15, 2015
@thefourtheye @Fishrock123
test: fix default value for additional param
52019a1
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 <[email protected]>
@Fishrock123 Fishrock123 mentioned this pull request Sep 15, 2015
Release proposal: v4.1.0 #2844
Closed
3 of 7 tasks
@rvagg rvagg mentioned this pull request Sep 22, 2015
Release proposal: v4.1.1 #2995
Merged
@trongham trongham mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities trongham/node#30
Open
@aliceUnhinged613 aliceUnhinged613 mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities aliceUnhinged613/node#56
Open
@adamlaska adamlaska mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities adamlaska/node#66
Open
@pratapadi pratapadi mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities pratapadi/node#9
Open
@aliscco aliscco mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#42
Open
@snyk-bot snyk-bot mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities RoeeOren/node#27
Open
@baby636 baby636 mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities baby636/node#53
Open
@Verdinjoshua26 Verdinjoshua26 mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities Verdinjoshua26/node#22
Open
@baophucct baophucct mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities baophucct/node#29
Open
@saeedahassan saeedahassan mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities saeedahassan/node#39
Open
@enterstudio enterstudio mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities enterstudio/node#27
Open
@GregorFendt GregorFendt mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities GregorFendt/node#21
Open
@ShubhraKar ShubhraKar mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities ShubhraKar/node#27
Open
@Mcculloughj Mcculloughj mentioned this pull request May 13, 2022
[Snyk] Security upgrade node-gyp from 7.1.2 to 8.4.1 Mcculloughj/node#35
Open
@snyk-bot snyk-bot mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities luke7oaks/node-1#31
Open
@ramonbrugman ramonbrugman mentioned this pull request May 13, 2022
[Snyk] Fix for 1 vulnerabilities ramonbrugman/node#20
Open
@ajesse11x ajesse11x mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities ajesse11x/node#36
Open
@wedataintelligence wedataintelligence mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities wedataintelligence/node#32
Open
@bumplzz69 bumplzz69 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities bumplzz69/node#36
Open
@erdun erdun mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities erdun/node#46
Open
@sirinartk sirinartk mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities sirinartk/node#32
Open
@Qdigital Qdigital mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities Qdigital/node#28
Open
@kaocher82 kaocher82 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities Xtuden-com/node#27
Open
@vaibhavb vaibhavb mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities vaibhavb/node#26
Open
@solebox solebox mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities solebox/node#30
Open
@apoorvanand apoorvanand mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities apoorvanand/node-2#26
Open
@terrorizer1980 terrorizer1980 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities terrorizer1980/node-1#10
Open
@snyk-bot snyk-bot mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities olegnn/node#39
Open
@molllyn1 molllyn1 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities molllyn1/node#47
Open
@AyushG3112 AyushG3112 mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities AyushG3112/node#27
Open
@s4sc s4sc mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities s4sc/node#27
Open
@yotamselementor yotamselementor mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities yotamselementor/node#20
Open
@xphillyx xphillyx mentioned this pull request May 14, 2022
[Snyk] Fix for 1 vulnerabilities xphillyx/node#14
Open
@AyushG3112 AyushG3112 mentioned this pull request Jun 22, 2022
[Snyk] Fix for 1 vulnerabilities AyushG3112/node#28
Open
@snyk-bot snyk-bot mentioned this pull request Jun 24, 2022
[Snyk] Fix for 7 vulnerabilities adamlaska/node#70
Open
@snyk-bot snyk-bot mentioned this pull request Sep 23, 2022
[Snyk] Fix for 2 vulnerabilities 137717unity/node#66
Open
@Verdinjoshua26 Verdinjoshua26 mentioned this pull request Sep 26, 2022
[Snyk] Fix for 9 vulnerabilities Verdinjoshua26/node#24
Open
This was referenced Sep 26, 2022
[Snyk] Fix for 2 vulnerabilities wedataintelligence/node#46
Open
[Snyk] Fix for 11 vulnerabilities vaibhavb/node#35
Open
@RoeeOren RoeeOren mentioned this pull request Oct 5, 2022
[Snyk] Fix for 9 vulnerabilities RoeeOren/node#32
Open
@MrBrain295 MrBrain295 mentioned this pull request Oct 5, 2022
[Snyk] Fix for 1 vulnerabilities MrBrain295/node#7
Open
@bumplzz69 bumplzz69 mentioned this pull request Oct 5, 2022
[Snyk] Fix for 11 vulnerabilities bumplzz69/node#39
Open
@snyk-bot snyk-bot mentioned this pull request Oct 9, 2022
[Snyk] Fix for 2 vulnerabilities Rednickle/node-1#62
Open
@solebox solebox mentioned this pull request Nov 27, 2023
[Snyk] Fix for 3 vulnerabilities solebox/node#33
Open
@s4sc s4sc mentioned this pull request Nov 28, 2023
[Snyk] Fix for 3 vulnerabilities s4sc/node#32
Open
@enterstudio enterstudio mentioned this pull request Nov 29, 2023
[Snyk] Fix for 3 vulnerabilities enterstudio/node#32
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@thefourtheye @rmg @bnoordhuis
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.