Skip to content

[dict] Implement __eq__ for dict_items #155154

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

Open
wants to merge 21 commits into
base: gh/guilhermeleobas/166/base
Choose a base branch
from

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jun 4, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/155154

Note: Links to docs will display an error until the docs builds have been completed.

❌ 10 New Failures

As of commit 8117387 with merge base e619c6b (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Jun 4, 2025
ghstack-source-id: cb4cef8
Pull Request resolved: #155154
[ghstack-poisoned]
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Jun 5, 2025
ghstack-source-id: 6ee643c
Pull Request resolved: #155154
[ghstack-poisoned]
guilhermeleobas added a commit that referenced this pull request Jun 9, 2025
ghstack-source-id: 22312e8
Pull Request resolved: #155154
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@guilhermeleobas guilhermeleobas marked this pull request as ready for review July 10, 2025 19:30
[ghstack-poisoned]
Comment on lines +1337 to +1343
def call_method(self, tx, name, args, kwargs):
if name == "__eq__":
assert len(args) == 1
if isinstance(args[0], DictItemsVariable):
return self.dv_dict.call_method(tx, "__eq__", [args[0].dv_dict], {})
return ConstantVariable.create(False)
return super().call_method(tx, name, args, kwargs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one should actually check if args[0] implements a mapping protocol and go from there.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants