lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.37k stars 156 forks source link

Support to print `u32` and `u64` in REPL #2717

Closed Vipul-Cariappa closed 1 month ago

Vipul-Cariappa commented 1 month ago

Example:

❯ lp
>>> x: u32 = u32(1)
>>> x
1
>>> x << u32(31)
2147483648
>>> x = u32(0)
>>> i: i32
>>> for i in range(1, 32):
...   x += u32(1) << u32(i)
... 
>>> x
4294967294
Vipul-Cariappa commented 1 month ago

cc @Shaikh-Ubaid