From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-02-07T18:23:26+09:00 Subject: Re: returning multiple values from a method In article <1013061331.673426.25491.nullmailer@ev.netlab.jp>, Yukihiro Matsumoto wrote: >Hi, > >In message "returning multiple values from a method" > on 02/02/07, Phil Tomson writes: > >|What is the reason for the inconsistency? > >Although it might not follow your expectation, they are consistent, >because they are just different. > > a = foo() # single assignment > a, = foo() # retrieve first element > a, b = foo() # first and second > a, *b = foo() # first and rest So the general principle is that you can avoid the '*' prefix if you are assigning to one and only one variable. a = foo() # single assignment is the same as: a* = foo() Correct? So based on this and the use of ',' that you show above I would tend to expect: a,b = foo() # first and rest a, *b = foo() # first and rest (same as previous) a,b, = foo() # first and second Then there doesn't seem to be a special case. But I don't think this is a serious issue... (I'm not proposing an RCR :). Phil