Python - Why Does Extend() And Append() Return None (void)?
Possible Duplicate: why does python's list.append evaluate to false? In my opinion, I think list1.extend(list2) and list1.append(num) should return the mutated list rather than
Solution 1:
I believe the intent was to promote readable code and reduce bugs. This decision was made a very long time ago, but you can probably find more by looking at the archives of the python/python-dev mailing lists.
Python3 would have been the opportunity to change this behaviour, but as you see it remains, so is not considered a design mistake by the development team
Post a Comment for "Python - Why Does Extend() And Append() Return None (void)?"