implement keyword arguments

This commit is contained in:
Philipp Moritz
2016-06-03 00:10:17 -07:00
parent 5ca5f7502b
commit 429d9025eb
4 changed files with 59 additions and 3 deletions
+14
View File
@@ -38,3 +38,17 @@ def empty_function():
@orchpy.distributed([], [int])
def trivial_function():
return 1
# Test keyword arguments
@orchpy.distributed([int, str], [str])
def keyword_fct1(a, b="hello"):
return "{} {}".format(a, b)
@orchpy.distributed([str, str], [str])
def keyword_fct2(a="hello", b="world"):
return "{} {}".format(a, b)
@orchpy.distributed([int, int, str, str], [str])
def keyword_fct3(a, b, c="hello", d="world"):
return "{} {} {} {}".format(a, b, c, d)