Ha, maybe this comes from my C programming background, but yes, I would expect a=2 to evaluate to 2!
I've always wondered why python didn't support this. I guess its the same "design" decision. What do you have against such behavior?
On Fri, Aug 13, 2010 at 11:33 PM, Jon Stanley <[address removed]>
On Fri, Aug 13, 2010 at 11:23 PM, Jordan P <[address removed]> wrote:You're taking in-place action on the list. Personally, I don't think
> Why the decision was made to not return anything from list methods. Because
> honestly, I can't imagine why they do not.
it makes sense (and would be confusing) for Python to return the
results of that in place manipulation. IMHO, it's doing the exact
right thing. Where does it stop? Take the following example:
In : a = 2
In : a += 2
In : a
Would you consider it appropriate for the first and second statements
to return 2 and 4, respectively? I sure don't - I'm performing an
operation on the variable that I want to be reflected *in that
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jon Stanley ([address removed]) from The New York Python Meetup Group.
To learn more about Jon Stanley, visit his/her member profile: http://www.meetup.com/nycpython/members/3908927/
To unsubscribe or to update your mailing list settings, click here: http://www.meetup.com/nycpython/settings/
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]