MRAB: > >>> # With a list > >>> tally = array('H', [0] * 75) > >>> > >>> # With a generator > >>> tally = array('H', (0 for i in range(75)))
Time ago we have had a long discussion about this, the right way is: tally = array(someformat, [0]) * 75 (If you need to initialize it to something that isn't constant then you may have to do something different). Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list