Opened 5 years ago

Closed 5 years ago

#6303 enhancement closed duplicate (duplicate)

FlagsConstants objects need __nonzero__

Reported by: Wilfredo Sánchez Vega Owned by: Wilfredo Sánchez Vega
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch: branches/flags-nonzero-6303
branch-diff, diff-cov, branch-cov, buildbot
Author: wsanchez

Description

This is rather unexpected:

>>> bool(QueryFlags.caseInsensitive & QueryFlags.NOT)
True

You have to use .value:

>>> bool((QueryFlags.caseInsensitive & QueryFlags.NOT).value)
False
>>> bool((QueryFlags.caseInsensitive & QueryFlags.caseInsensitive).value)
True

Change History (4)

comment:1 Changed 5 years ago by Wilfredo Sánchez Vega

Author: wsanchez
Branch: branches/flags-nonzero-6303

(In [37141]) Branch for #6303

comment:2 Changed 5 years ago by Wilfredo Sánchez Vega

An updated fix for is included with #6302.

comment:3 Changed 5 years ago by Wilfredo Sánchez Vega

Owner: set to Wilfredo Sánchez Vega
Status: newassigned

comment:4 Changed 5 years ago by Wilfredo Sánchez Vega

Resolution: duplicate
Status: assignedclosed

With was fixed with #6302

Note: See TracTickets for help on using tickets.