From 0842d921871a9bd33011d35fdd554189766bcf7c Mon Sep 17 00:00:00 2001 From: jomo Date: Fri, 2 Jan 2015 01:23:17 +0100 Subject: docs --- calc.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'calc.py') diff --git a/calc.py b/calc.py index 0b1000a..d05f876 100644 --- a/calc.py +++ b/calc.py @@ -5,7 +5,12 @@ math_operators = ["+", "-", "*", "/", "&", "|"] ignore_operators = ["**", "&&", "||"] # ** may be too intensive, the others cause syntax errors calc_perm = "utils.calc" + def calc(text): + """ + extracts a mathematical expression from `text` + returns (expression, result) or None + """ expression = "" should_calc = False for char in text: -- cgit v1.2.3