Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mypyc] Add 'bit' primitive type and streamline branching #9606

Merged
merged 13 commits into from
Oct 17, 2020
Prev Previous commit
Next Next commit
Update comments
  • Loading branch information
JukkaL committed Oct 17, 2020
commit 1aecd483fb2ffbf387b5a68756435b1d2c519bc2
8 changes: 5 additions & 3 deletions mypyc/ir/rtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,15 @@ def __repr__(self) -> str:
float_rprimitive = RPrimitive('builtins.float', is_unboxed=False,
is_refcounted=True) # type: Final

# An unboxed boolean value. This actually has three possible values
# (0 -> False, 1 -> True, 2 -> error).
# An unboxed Python bool value. This actually has three possible values
# (0 -> False, 1 -> True, 2 -> error). If you only need True/False, use
# bit_rprimitive instead.
bool_rprimitive = RPrimitive('builtins.bool', is_unboxed=True, is_refcounted=False,
ctype='char', size=1) # type: Final

# A low-level boolean value with two possible values: 0 and 1. Any
# other value results in undefined behavior.
# other value results in undefined behavior. Undefined or error values
# are not supported.
bit_rprimitive = RPrimitive('bit', is_unboxed=True, is_refcounted=False,
ctype='char', size=1) # type: Final

Expand Down