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

Check object is instance of PlexPartialObject for __eq__ comparison #1182

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

JonnyWong16
Copy link
Collaborator

Description

Check object is instance of PlexPartialObject for __eq__ comparison.

Fixes #1175

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

@JonnyWong16 JonnyWong16 merged commit b06afb8 into pkkid:master Jul 27, 2023
@JonnyWong16 JonnyWong16 deleted the bugfix/plexpartialobject_eq branch July 27, 2023 21:46
@@ -489,7 +489,9 @@ class PlexPartialObject(PlexObject):
}

def __eq__(self, other):
return other not in [None, []] and self.key == other.key
if isinstance(other, PlexPartialObject):
return other not in [None, []] and self.key == other.key
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't it superfluous to check None and [], as isinstance(other, PlexPartialObject): check is already made?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, good catch.

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

PlexPartialObject causes an exception when compared against a non-PlexPartialObject object.
2 participants