[Pyobjc-dev] Re: [Python-Dev] PyBuffer* vs. array.array()
Brought to you by:
ronaldoussoren
From: Scott G. <xs...@ya...> - 2003-01-05 22:19:14
|
--- Guido van Rossum <gu...@py...> wrote: > > In writing the unit tests, I came across a problematic situation that > > could easily arise in code (feel free to comment on the silliness of > > this code, if any... and note that I'm using the comprehension style > > even after that long rant I posted earlier :-): > > > > singlePlane = array.array('B') > > singlePlane.fromlist([0 for x in range(0, width*height*3)] ) > > I'm not sure if you were joking, but why not write > > singlePlane.fromlist([0] * (width*height*3)) > > ??? > Or cheaper and faster for large width and height: singlePlane = array.array('B', [0])*width*height*3 __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |