or pop()or del [- def topopnd(self)return self opnd[- top operand (end of listdef open(self)self optr append('('treat '(like an operator def close(self)self shiftoptr(')'self optr[- :[on ')pop downto highest '(ok if emptystays empty popor added again by optr def closeall(self)while self optrforce rest on 'evalself reduce(last may be var name tryself opnd[ self runstring(self opnd[ ]exceptself opnd[ '*error*pop else added again nextafterme {'*'['+''-''(''=']'/'['+''-''(''=']'+'['(''=']'-'['(''=']')'['(''=']'='['('class member optrs to not pop for key if prior optr is thispush elsepop/eval prior optr all left-associative as is def shiftopnd(selfnewopnd)self opnd append(newopndpush opnd at optr')'eval def shiftoptr(selfnewoptr)apply ops with <priority while (self optr and self optr[- not in self afterme[newoptr])self reduce(self optr append(newoptrpush this op above result optrs assume next opnd erases def reduce(self)trace(self optrself opndtrycollapse the top expr operator self optr[- pop top optr (at end[leftrightself opnd[- :pop top opnds (at endself optr[- :[delete slice in-place self opnd[- :[result self runstring(left operator rightif result =noneresult left assignmentkey var name self opnd append(resultpush result string back exceptself opnd append('*error*'stack/number/name error def runstring(selfcode)tryresult str(eval(codeself namesself names)self hist append(code =resultexcept text and language not ` `/repr try exprstring add to hist log