PEP8 has limitations. "field is True" would never work because the "is" operator cannot be overloaded. Only the "==" can be overloaded.
Massimo On Sunday, 16 February 2014 12:41:48 UTC-6, Julio F. Schwarzbeck wrote: > > Folks, > > take a look at this piece of code: > > topics = db((db.topic.id == topic_id) & (db.topic.active == > True)).select() > > PEP8 is breaknig with the following error: > > > default.py:xxx:yy: E712 comparison to True should be 'if cond is True:' > or 'if cond:' > > And of course changing (db.topic.active == True) > To (db.topic.active) > Or (db.topic.active is True) > > Passes the PEP8 test, but it does not yield any results. > > Any suggestions on how to handle this? - I know PEP8 are just > 'recommendations' but I wonder if there is another way to handle this.. > > Thanks, > > Julio > > -- 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/groups/opt_out.

