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 __contains__ on tuple pk searches #20

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

pydanny
Copy link
Contributor

@pydanny pydanny commented Aug 21, 2024

As lists cannot be added to tuples and vice-versa, we cast pk_values to a list.

Python 3.10.6 (main, Dec 12 2023, 14:13:45) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> [] + ()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "tuple") to list
>>> () + []
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can only concatenate tuple (not "list") to tuple

@pydanny pydanny changed the title Fix contains on tuple pks Fix __contains__ on tuple pk searches Aug 21, 2024
@pydanny pydanny force-pushed the fix-contains-on-tuple-pks branch 2 times, most recently from b2375c3 to 8a741f6 Compare August 21, 2024 07:01
@pydanny pydanny force-pushed the fix-contains-on-tuple-pks branch from 8a741f6 to 022625f Compare August 21, 2024 07:04
@pydanny pydanny requested a review from jph00 August 21, 2024 07:04
@jph00 jph00 merged commit d8f4102 into main Aug 21, 2024
@jph00
Copy link
Contributor

jph00 commented Aug 21, 2024

Thank you!

@pydanny pydanny added the bug Something isn't working label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants