Tuples -> Function Params?
Duncan Booth
duncan at NOSPAMrcp.co.uk
Tue Dec 4 03:57:16 EST 2001
Philip Swartzleonard <starx at pacbell.net> wrote in
news:Xns916D6505401FRASXnewsDFE1 at 130.133.1.4:
> a,b,c = self.color
> glColor3f(a,b,c)
>
> Ok, the question is, is there a way to do this where i don't
> unpack
> the tuple and pass sepearte arugments?
Recent versions of Python:
glColor3f(*self.color)
For older versions, use the apply function.
--
Duncan Booth duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
More information about the Python-list
mailing list