Skip to content

fix: value not working on HexInt#26

Open
antazoey wants to merge 3 commits intoApeWorX:mainfrom
antazoey:fix/empty-hex
Open

fix: value not working on HexInt#26
antazoey wants to merge 3 commits intoApeWorX:mainfrom
antazoey:fix/empty-hex

Conversation

@antazoey
Copy link
Copy Markdown
Member

What I did

fixes: #

How I did it

How to verify it

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey antazoey requested a review from fubuloubu September 16, 2025 22:26


def test_0x():
model = IntModel(value="0x")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question though, wouldn't this be like "empty bytes" instead of the number 0?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but wondering what should the behavior be when a model gets it for a hexint

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel like it should raise

Maybe it doesn't matter, a parameter using HexInt should always expect a value but seems unnecessary to have it raise just for empty if someone makes a small mistake

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. you can do a = 0x0 in python, but a = 0x wouldn't parse

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh I can't remember why I ran into this problem so raising might be OK

@fubuloubu fubuloubu changed the title fix: "0x" value not working on HexInt fix: value not working on HexInt Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants