[Numpy-discussion] exec: bad practice?
Alan G Isaac
Tue Sep 15 07:34:35 CDT 2009
On 9/15/2009 7:07 AM, Sebastien Binet wrote:
> usage of the exec statement is usually frown upon and can be side stepped.
> for m in meat:
> for c in cut:
> locals()['consumed_%s_%s' % (m,c)] = some_array
Additionally, name construction can be pointless.
info = dict()
for pr in itertools.product(meat, cut):
info[pr] = f(pr)
More information about the NumPy-Discussion