Quoting Robert Bragg (2017-03-01 08:58:09) > On Wed, Mar 1, 2017 at 3:57 PM, Robert Bragg <rob...@sixbynine.org> wrote: > > On Mon, Feb 27, 2017 at 8:01 PM, Dylan Baker <dy...@pnwbakers.com> wrote: > > >>> +def output_rpn_equation_code(set, counter, equation, counter_vars): > >>> + c("/* RPN equation: " + equation + " */") > >>> + tokens = equation.split() > >>> + stack = [] > >>> + tmp_id = 0 > >>> + tmp = None > >>> + > >>> + for token in tokens: > >>> + stack.append(token) > >>> + while stack and stack[-1] in ops: > >>> + op = stack.pop() > >>> + argc, callback = ops[op] > >>> + args = [] > >>> + for i in range(0, argc): > >> > >> Use xrange instead of range > > > > okey, can do. > > I just realised that the use of xrange() became the only thing > stopping the script from being python version agnostic (python 3 > removes xrange and plain range() behaves like xrange()) so I went back > to using range() here.
No worries either way, it's not an extremely huge range, so python2's range isn't terrible (in python 3 "range" is python 2's "xrange"). I'm assuming that when we move to python3 in mesa that we'll be hybridized for years because of enterprise OSes. Dylan
signature.asc
Description: signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev