summaryrefslogtreecommitdiff
path: root/plac/doc/example10.py
diff options
context:
space:
mode:
Diffstat (limited to 'plac/doc/example10.py')
-rw-r--r--plac/doc/example10.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/plac/doc/example10.py b/plac/doc/example10.py
deleted file mode 100644
index 02bbdc6..0000000
--- a/plac/doc/example10.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# example10.py
-import plac
-
-@plac.annotations(
-operator=("The name of an operator", 'positional', None, str, ['add', 'mul']),
-numbers=("A number", 'positional', None, float, None, "n"))
-def main(operator, *numbers):
- "A script to add and multiply numbers"
- if operator == 'mul':
- op = float.__mul__
- result = 1.0
- else: # operator == 'add'
- op = float.__add__
- result = 0.0
- for n in numbers:
- result = op(result, n)
- return result
-
-if __name__ == '__main__':
- print(plac.call(main))