On Wednesday, January 4, 2017 at 4:28:28 PM UTC-5, backseat wrote:
>
> My PEP8 checker tells me that:
>
> db.table.field == None
>
> should be
>
> db.table.field is None
>

When creating expressions with DAL Field objects, we don't want to generate 
boolean values but instead need to generate Query objects. This is achieved 
via *overloading *of Python's logical operators (i.e., ==, !=, <, >, etc.). 
It is not possible to override Python's identity operators (i.e., is and is 
not), so we must use == and != instead. This also makes all logical 
comparisons consistent, using just the logical operators rather than a mix 
of logical operators and identity operators.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to