On Wed, Jun 1, 2011 at 10:51 PM, Christopher Night <cosmologi...@gmail.com>wrote:
> On Wed, Jun 1, 2011 at 2:47 AM, René Dudfield <ren...@gmail.com> wrote: > >> 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. >>> >>> >> 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. >> > > I've had applications where I want to draw a single line, and many where > I've wanted to draw a single circle, arc, or polygon. > > I don't expect that performance is a big issue, but I think it makes sense > to have a version for just drawing a single item. Every graphical API that > I'm familiar with allows you to draw a single item without putting it in a > container. Is it common not to? Should pygame.draw.line be deprecated as > well? > > -Christopher > Hi, Do you think that the extra brackets are too much? The pygame.draw API will stay including pygame.draw.line function. I'm talking about changing the experimental gfxdraw module (maybe under a different name like how Lorenz says). Looking at how people use pygame.draw.line... I notice that most people draw multiple lines with it - but there are a couple of single lines drawn too. See this codesearch for pygame.draw.line: http://www.google.com/codesearch?q=file%3A\.py%24+pygame.draw.line Anyway, I think it sounds like most people want - or at least expect - single versions of the functions too. The other reason that Greg gave about it being less clear is true as well I think. line(...) is obviously one line, and lines(...) is obviously multiple lines. lines(surf, ((p0, p1, color),)) also does seem to have a lot of parentheses! As well, because of the weird python tuple oddity - you need that trailing comma. bye,