Skip to content

Commit e6f698f

Browse files
authored
Merge pull request #2859 from certik/pypi
Add the `lpython` pypi package sources
2 parents 05fa324 + 103d684 commit e6f698f

File tree

5 files changed

+1014
-0
lines changed

5 files changed

+1014
-0
lines changed

src/runtime/pypi/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 The LCompilers Team
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

src/runtime/pypi/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# lpython
2+
3+
https://lpython.org/
4+
5+
This is a python package to add typing information to python code. Use LPython
6+
to compile it.
7+
8+
## Example
9+
10+
```python
11+
from lpython import i32, f64
12+
13+
def add(a: i32, b: i32) -> i32:
14+
return a + b
15+
16+
def area_of_circle(radius: f64) -> f64:
17+
pi: f64 = 3.14
18+
return pi * (radius * radius)
19+
20+
def main0():
21+
print("The sum of 5 and 3 is", end=" ")
22+
print(add(5, 3))
23+
print("Area of circle with radius 5.0 is", end=" ")
24+
print(area_of_circle(5.0))
25+
26+
main0()
27+
```
28+
29+
```bash
30+
$ python main.py
31+
The sum of 5 and 3 is 8
32+
Area of circle with radius 5.0 is 78.5
33+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .lpython import i8, i16, i32, i64, u8, u16, u32, u64, f32, f64, c32, c64, CPtr, Allocatable, overload, ccall, TypeVar, pointer, c_p_pointer, Pointer, p_c_pointer, vectorize, inline, Union, static, packed, Const, sizeof, ccallable, dataclass, In, Out, InOut, ccallback, Callable

0 commit comments

Comments
 (0)