﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30103	Allow Q objects to be hashable, so that they can be used in sets	Keryn Knight	nobody	"Given:
{{{
>>> x = set()
>>> x.add(Q(a=1))
>>> x.add(Q(a=1))
}}}
I was *expecting* that the `x` would end up with `{<Q: (AND: ('a', 1))>}` but instead it ends up with `{<Q: (AND: ('a', 1))>, <Q: (AND: ('a', 1))>}`

For Q objects to work in sets (and as dictionary keys I guess) the class would need to implement `__hash__` and `__eq__` methods I think. This is slightly complicated by the fact it consumes all `*args, **kwargs` so doesn't necessarily have a concrete set of values to easily equality-check (and they could feasibly be nested, and in a different order [eg: `Q(a=1, b=2)` and `Q(b=2, a=1)`)"	New feature	closed	Database layer (models, ORM)	dev	Normal	duplicate		Keryn Knight	Unreviewed	0	0	0	0	0	0
