Allow use of ==, !=, <=, <, >, >= and ~ operators in F() expression comparisons.
The only problematic case here is the override of eq which will break using F() expressions in dicts or sets, and of course comparing two F() expressions should be done with 'f1 is f2 ' instead of 'f1 == f2'.
Pull create for easier review.
Removed use of ExpressionNodes in dicts
Fixed #16211 -- Added comparison and negation ops to F() expressions
Work done by Trac aliases wdoekes and knoeb, reviewed by Simon
Splitted expression tests into smaller parts
I'm pretty sure there's no good reason to put an F() obj into a set or dict, so I wouldn't lose sleep over it.
Does anything prevent you from redefining hash ?
You don't want to have an hash with an eq that returns non-boolean results.
Seems like the options are to not ever support comparison operators for F() expressions, or just push this in. I am in favour of merging this even if this creates an uneasy feeling.
Works for me ;)
Oh, and thanks for picking this up!
Pushed in manually in ddd7d1a, 28abf5f and c253282