This commit is contained in:
2024-11-29 18:15:30 +00:00
parent 40aade2d8e
commit bc9415586e
5298 changed files with 1938676 additions and 80 deletions

View File

@ -0,0 +1,25 @@
import logging
from entrypoint2 import entrypoint
__version__ = "3.2"
@entrypoint
def add(one: int, two=4, three=False):
"""This function adds two numbers.
:param one: first number to add
:param two: second number to add
:param three: print hello if True
:rtype: int
"""
# 'one' and 'two' are converted to int
s = one + two
logging.debug(s)
print(s)
if three:
print("hello")
return s

View File

@ -0,0 +1,16 @@
import logging
import hello # type: ignore
from entrypoint2 import entrypoint
__version__ = "5.2"
@entrypoint
def f():
"""calls hello"""
s = hello.add(7, 2)
logging.debug("logging sum from caller.py:" + s)
print("printing sum from caller.py:" + s)

View File

@ -0,0 +1,16 @@
from entrypoint2 import entrypoint
@entrypoint
def add(
strpar="string",
bytespar=b"bytes",
intpar=21,
floatpar=3.14,
boolpar=False,
):
print(f"strpar={repr(strpar)}")
print(f"bytespar={repr(bytespar)}")
print(f"intpar={repr(intpar)}")
print(f"floatpar={repr(floatpar)}")
print(f"boolpar={repr(boolpar)}")

View File

@ -0,0 +1,7 @@
from entrypoint2 import entrypoint
@entrypoint
def hello(message):
# type of 'message' is not defined, default is str
print(message)

View File

@ -0,0 +1,9 @@
from entrypoint2 import entrypoint
@entrypoint
def main(files=[]):
"""This function has repeating arguments.
:param files: test input
"""
print(files)

View File

@ -0,0 +1,18 @@
from entrypoint2 import entrypoint
@entrypoint
def func(
strpar: str,
bytespar: bytes,
intpar: int,
floatpar: float,
boolpar: bool,
listpar: list[int],
):
print(f"strpar={repr(strpar)}")
print(f"bytespar={repr(bytespar)}")
print(f"intpar={repr(intpar)}")
print(f"floatpar={repr(floatpar)}")
print(f"boolpar={repr(boolpar)}")
print(f"listpar={repr(listpar)}")

View File

@ -0,0 +1,6 @@
from entrypoint2 import entrypoint
@entrypoint
def func(*args):
print(args)