B8 (Boolean)¶
The B8 type represents a boolean value in raypy.
- Any non-zero integer value is converted to
True - Any non-empty string is converted to
True - The
B8type can be used directly in boolean contexts (if statements, etc.) - Comparison only works between
B8instances
Type Information¶
| Type | Rayforce Object Type Code | Size |
|---|---|---|
B8 |
-1 |
8 bits |
Creating B8 Values¶
from raypy import types as t
# From boolean values
>>> t.B8(True)
B8(True)
>>> t.B8(False)
B8(False)
>>> t.B8(0)
B8(False)
>>> t.B8(1)
B8(True)
# From string values (any non-empty string = True)
>>> B8("True")
B8(True)
>>> B8("False") # Note: still True because string is non-empty
B8(True)