Skip to content

New way to populate locals() for filter - #247

Closed
lukaszachy wants to merge 1 commit into
mainfrom
locals
Closed

lukaszachy wants to merge 1 commit into
mainfrom
locals

Conversation

@lukaszachy

Copy link
Copy Markdown
Contributor

Comment thread fmf/utils.py
"""
locals().update(data)
# Since python3.13 and https://peps.python.org/pep-0667/
_locals = copy.deepcopy(locals())

@happz happz Jun 17, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don’t believe deepcopy() is needed. locals() should regurn an independent snapshot of local namespace, i.e. we would be making (and updating) a copy of dictionary no other part of code can ever see. Seems superfluous.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In other words, I agree we need to store locals() somewhere if we need to both update it and pass it to a function call, ut IIUIC, we don’t need to work with a copy of said dictionary.

@lukaszachy

Copy link
Copy Markdown
Contributor Author

Drop in favor of #248

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.

py3.13 - fmf ls --condition 'float(release) >= 7' broken

2 participants