|
// TODO: Avoid overriding of user defined functions with same name as |
|
// intrinsics like print, quit and reserve. Right now, user defined |
|
// functions will never be considered. |
Example:
$ cat examples/expr2.py
from lpython import i32, InOut
def reserve(a: InOut[list[i32]], b: i32):
a.append(b)
print("user defined reserve() called")
def main0():
x: list[i32] = []
reserve(x, 5)
assert len(x) == 1
assert x[0] == 5
main0()
$ python examples/expr2.py
user defined reserve() called
$ lpython_in_main examples/expr2.py
AssertionError
lpython/src/lpython/semantics/python_ast_to_asr.cpp
Lines 6684 to 6686 in d24f131
Example:
$ python examples/expr2.py user defined reserve() called