42 lines
654 B
Python
42 lines
654 B
Python
from inspect import signature
|
|
|
|
from func_py import function
|
|
|
|
|
|
@function
|
|
def inc(x: int) -> int:
|
|
return x + 1
|
|
|
|
@function
|
|
def multi(a: int, b: int) -> int:
|
|
return a * b
|
|
|
|
@function
|
|
def add(a: int, b: int) -> int:
|
|
return a + b
|
|
|
|
|
|
|
|
def test_abc():
|
|
|
|
#print(add(2,3))
|
|
#print((inc * add)(2,3))
|
|
#print((inc * add))
|
|
|
|
#print(add(99))
|
|
print((add(99) * multi(100) * add(2) * (lambda x: x + 1)))
|
|
|
|
print(function.compose(lambda x: x + 1, lambda x: x * 3))
|
|
|
|
print(signature(function.compose(lambda x: x + 1, lambda x: x * 3)))
|
|
|
|
|
|
#print(inspect.signature(add))
|
|
#print(inspect.signature(add).parameters)
|
|
|
|
assert True
|
|
|
|
|
|
|
|
|