-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Feature Request] Introduce alias Byte = UInt8
#3634
Comments
I think it's also important to note that in Python byte is it's own object type with it's own type of representation (prints with Also, (btw typo in the title) |
alias Bype = UInt8
alias Byte = UInt8
Have you seen #2096 (comment) and our feedback there? I'd be open to someone adding a lightweight alias in the meantime to improve readability/express intent better at call sites. |
Yea, I think
Let's move forward with simply |
Sounds good, just added "good first issue". Whoever takes this, feel free to add the alias and we can incrementally apply it where we're working with "Bytes". |
Review Mojo's priorities
What is your request?
As title.
What is your motivation for this change?
It helps document the intent, especially in low-level code (e.g.,
memcpy
), where we treat the underlying type as just a pack of bits rather than a numerical type, similar to the distinction betweeni1
andbool
.We could introduce a nominal type
Byte
which implicitly converts toUInt8
, but that feels more complex than necessary.Any other details?
N/A
The text was updated successfully, but these errors were encountered: