#29838: Hashing list in Q objects when using __in lookup
--------------------------------------+-----------------------------------
Reporter: aspalding | Owner: aspalding
Type: Bug | Status: assigned
Component: Utilities | Version: master
Severity: Normal | Keywords: hash, tuple, list
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+-----------------------------------
This bug was previously reported here - #29643.
However I am still getting this error upon rendering QuerySets that use
the Q object and include the `__in` filter in the most recent release of
django, 2.1.2.
Here is my reproduction of the bug on master:
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!python
>>> q = Q(a__in=[1, 2])
>>> q.__hash__()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/aspalding/Documents/django/django/utils/tree.py", line 89,
in __hash__
for child in self.children
TypeError: unhashable type: 'list'
}}}
}}}
Therefor the minimal reproduction for `NodeTest` would look like:
{{{
#!div style="font-size: 80%"
Code highlighting:
{{{#!python
hash(Node([('a', [1, 2])]))
}}}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29838>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.a76160e6c3c602e91871e5cd42ffc862%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.