lpython
lpython copied to clipboard
Python compiler
```py from lpython import i32 class Base: def __init__(self:"Base"): self.x_A : i32 = 10 class Derived(Base): pass def check(x: Base): print(x.x_A) def main(): d : Derived = Derived() check(d) main()...
We should implement *runtime polymorphism*, using virtual function tables. Here is the simplest example: ```python # Base class class A: def myprint(): print("A") def f(a: A): a.myprint() ``` The function...
Example : ```py from lpython import i32 class Base: def __init__(self:"Base"): self.x_A : i32 = 10 class Derived(Base): def __init__(self:"Derived") : super().__init__() self.y_B : i32 = 6 def get_x_A(self:"Derived"): print(self.x_A)...
I am adding GitHub workflow to run LLVM related tests with other versions of LLVM that are supported by LFortran (PR: #2754). But the tests fail with a segfault when...
fixes #2777
Addition of shallow copying in the ASR, and using them in some places.
While printing `dataclass` in REPL, LPython segfaults. Printing of `dataclass` in REPL is being supported by #2785. Reference: https://github.com/lcompilers/lpython/pull/2785#discussion_r1686592482 and https://github.com/lcompilers/lpython/pull/2785#issuecomment-2243134157
Allows non variable sets and dictionaries to be passed into function calls.
Missed this in the previous PR.