Paul Rubin wrote: > It gets messy for a more complicated structure: > > d = {'x': x1() if x_is_old else x2(), > 'y': y1() if y_is_old else y2(), > 'z': z1() if z_is_old else z2() } > etc.
somewhere between the '}' and the '.', a data-driven approach will be more readable, easier to maintain, and nearly as efficient. (and with an example as regular as yours, the data table can be auto- generated...) </F> -- http://mail.python.org/mailman/listinfo/python-list