Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty dict as default arg #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eudoxos
Copy link

@eudoxos eudoxos commented Feb 11, 2022

See e.g. https://towardsdatascience.com/python-pitfall-mutable-default-arguments-9385e8265422

(It happened to me that an object was stubbornly getting color set in previous runs.)

@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #322 (14146f8) into master (0d091ba) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #322   +/-   ##
=======================================
  Coverage   88.59%   88.59%           
=======================================
  Files          19       19           
  Lines        1490     1491    +1     
  Branches      201      201           
=======================================
+ Hits         1320     1321    +1     
  Misses        137      137           
  Partials       33       33           
Impacted Files Coverage Δ
cq_editor/widgets/object_tree.py 93.92% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d091ba...14146f8. Read the comment docs.

@adam-urbanczyk
Copy link
Member

Thanks, how did you manage to modify the dict? Or did it happen in the CQ-editor code?

@eudoxos
Copy link
Author

eudoxos commented Feb 28, 2022

Thanks, how did you manage to modify the dict? \

I can't remember anymore; I was trying different ways to make show_object show the object with label (and persistent properties) in the CQ editor; and then it happened that re-running the script with options removed was still setting the color.

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.

2 participants