# HG changeset patch # User Teemu Piippo # Date 1452529699 -7200 # Node ID ed3d52b37f19405dc4512dfb86cdde3c68805e5e # Parent d24fe5e3e4204a4d20b4fa9624245ccc2b30e0e7 Remove use of enum in the calculator to drop minimum required version diff -r d24fe5e3e420 -r ed3d52b37f19 calculator.py --- 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)