Simple question on Parameters...

Hans Nowak hans at zephyrfalcon.org
Wed Dec 28 17:17:23 EST 2005


KraftDiner wrote:
> I guess its all good...
> I just am not crazy about using fillColor[0]  id rather use fillColor.r

You don't have to use fillColor[0], you can use tuple unpacking to name 
the elements of the tuple.  E.g.

def renderABezierPath(self, path, closePath=True, outlineColor=(1.0, 
1.0, 1.0, 1.0), fillColor=(0.0, 0.0, 0.0, 0.25)):
     r, g, b, a = outlineColor
     fr, fg, fb, fa = fillColor
     ...do something with these values...


-- 
Hans Nowak
http://zephyrfalcon.org/



More information about the Python-list mailing list