, operator_stack , IndexError BTW, None, :
:
peek = operator_stack[-1] if operator_stack else None
:
peek = operator_stack[len(operator_stack)-1]
, :
49: while not operator_stack and prec[peek] >= prec[element]:
59: while not operator_stack:
:
49: while operator_stack and prec[peek] >= prec[element]:
59: while operator_stack:
, if, , peek None
peek = operator_stack[-1] if operator_stack else None
if peek is not None:
while operator_stack and prec[peek] >= prec[element]:
output_queue.append(operator_stack.pop())
operator_stack.append(element)
while operator_stack:
output_queue.append(operator_stack.pop())
, while operator_stack:, . :
>>> a = [2,5,6]
>>> while a:
... print 2
... break
2