On Tue, May 31, 2011 at 10:02 PM, Greg Ewing <greg.ew...@canterbury.ac.nz>wrote:
> René Dudfield wrote: > > I'm thinking of removing the single calls, and only having multiple ones >> available - to force people into using the more efficient methods. >> > > -1 if this means I'd have to build a list if I just want > to draw one item, because that introduces inefficiencies > of its own and makes the code less clear. > > -- > Greg > Hello, I understand the concerns about readability, and speed impacts. However, I'm not sure it adds much clutter visually for the single use case. Just add a couple of extra brackets. Also, the most common use case is drawing multiple items. I can't think of one real application where I've only drawn one element off the top of my head. Secondly, it seems to be slightly faster using the multiple item style API for one item, - according to this little (unscientific) test I did with ipython. In [12]: def line(a,b,c,d):pass ....: In [13]: def lines(points):pass ....: In [14]: %timeit line(1,2,3,4) 1000000 loops, best of 3: 232 ns per loop In [15]: %timeit lines((1,2,3,4)) 10000000 loops, best of 3: 194 ns per loop