Il 2005-12-28, KraftDiner <[EMAIL PROTECTED]> ha scritto: > I have defined a method as follows: > > def renderABezierPath(self, path, closePath=True, r=1.0, g=1.0, b=1.0, > a=1.0, fr=0.0, fg=0.0, fb=0.0, fa=.25): > > Now wouldn't it be simpler if it was: > > def renderABezierPath(self, path, closePath=True, outlineColor, > fillColor): > > But how do you set default vaules for outlineColor and fillColors?
You can make renderABezierPath like this: def renderABezierPath(self, path, closePath=True, outlineColor=(1.0, 1.0, 1.0, 1.0), fillColor=(0.0, 0.0, 0.0, 0.25)): and in the body you unpack the tuples -- Lawrence - http://www.oluyede.org/blog "Anyone can freely use whatever he wants but the light at the end of the tunnel for most of his problems is Python" -- http://mail.python.org/mailman/listinfo/python-list