# Failed to use Python hex() function in Mojo

**URL:** <https://forum.modular.com/t/failed-to-use-python-hex-function-in-mojo/1586>\
**Category:** Mojo\
**Created:** [June 4, 2025, 5:50pm UTC](https://forum.modular.com/t/failed-to-use-python-hex-function-in-mojo/1586 "2025-06-04T17:50:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sora](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@sora](https://forum.modular.com/u/sora)\
**Post date:** [June 4, 2025, 7:36pm UTC](https://forum.modular.com/t/failed-to-use-python-hex-function-in-mojo/1586/2 "2025-06-04T19:36:10Z")

</div>

The number gets automatically converted to `Int`, which is 64 bits wide on 64-bit systems.  
Unfortunately, casting to `UInt128` or a larger type also won’t work:

- We didn’t implement that path to Python.
- Blocked by this bug: [[BUG] Cant instantiate variable of UInt256 with more than 128 bit value · Issue #4049 · modular/modular · GitHub](https://github.com/modular/modular/issues/4049)

---

_[View the full topic](https://forum.modular.com/t/failed-to-use-python-hex-function-in-mojo/1586)._
