Add helper func.

- tests a bit at specified position.
This commit is contained in:
Dhananjay Balan
2013-08-25 23:04:20 +05:30
committed by Chris Johns
parent a7176a8a7e
commit a4d0739522

View File

@@ -16,3 +16,6 @@ def type_from_value(val):
type = type.target ()
# Get the unqualified type
return type.unqualified ()
def test_bit(val, pos):
return bool(val & (1 << (pos-1)))