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(attrmatch): use None to match missing attributes #643

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

Conversation

ahal
Copy link
Collaborator

@ahal ahal commented Feb 10, 2025

No description provided.

@ahal ahal self-assigned this Feb 10, 2025
Copy link
Contributor

@jcristau jcristau left a comment

Choose a reason for hiding this comment

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

This feels like a slightly too subtle incompatible change. None used to only match None, now it also matches a missing attribute. That feels a bit scary, in terms of unintended consequences, plus it means there's no longer a way to match an attribute that's present but null?

@ahal
Copy link
Collaborator Author

ahal commented Feb 11, 2025

Yes, valid points. I did consider introducing some kind of other syntax, we could set it to a constant value like missing, or we could prefix the key with ! or something like that. One complication here is that I want to be able to define the kwargs in yaml, so that precludes a sentinel object or the like.

One reason I thought this would be a good approach, is that the only place this is used (in Gecko and this repo at least), is in from-deps.with-attributes. And afaict we aren't setting anything to None there.

But we could implement something else. Do you have any preferences for handling the distinction?

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