Optional assignments ?

Robert Kern rkern at ucsd.edu
Sun Aug 7 13:46:05 EDT 2005


Madhusudan Singh wrote:
> Hi
> 
> Is it possible to have something like :
> 
> a,b,c,d=fn(that returns 10 return values) ?

a,b,c,d = fn()[:4]

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter




More information about the Python-list mailing list