Open faze-geek opened 7 months ago
from numpy import int32 from enum import Enum class ArraySizes(Enum): SIZE_3: i32 = 3 SIZE_10: i32 = 10 def f(xi32: i32[:]) -> i32: xi32[0] = 1 xi32[1] = 2 xi32[2] = 3 xi32[3] = 4 print(xi32) print(xi32[3]) def d(): ai32: i32[ArraySizes.SIZE_3] = empty(ArraySizes.SIZE_3.value, dtype=int32) f(ai32) d() (lp) C:\Users\kunni\lpython>src\bin\lpython try.py 1 2 3 4
Similarly for other creation methods like using empty().
empty()