Idiom for default values when unpacking a tuple

Scott David Daniels Scott.Daniels at Acm.Org
Wed Nov 17 16:06:44 EST 2004


Paul McGuire wrote:
> So is there any easy way for the pad function to figure out for itself that
> the target length is 3, without my having to tell it so?
Nope.
If there were, what would you propose the function "pad" below use as a
desired length in the statement:

     a,b,c = pad(something)[1:4]

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list