Mon, 11 Jan 2016 18:28:19 +0200
Remove use of enum in the calculator to drop minimum required version
calculator.py | file | annotate | diff | comparison | revisions |
--- a/calculator.py Sat Dec 12 04:04:10 2015 +0200 +++ b/calculator.py Mon Jan 11 18:28:19 2016 +0200 @@ -34,7 +34,6 @@ import time import operator import string -import enum from fraction import Fraction from copy import deepcopy from math import pi as π @@ -259,7 +258,11 @@ Tokens = {'(', ')'} # Symbol table -SymbolType = enum.Enum ('SymbolType', ('constant', 'function', 'operator', 'token')) +class SymbolType: + constant = 0 + function = 1 + operator = 2 + token = 3 SymbolTypes = {} Symbols = {'ans'} SymbolTypes['ans'] = SymbolType.constant @@ -805,4 +808,4 @@ return self.calc (expr) calc = Calculator() -dcalc = Calculator(verbose=True) \ No newline at end of file +dcalc = Calculator(verbose=True)