News for hackers. Stuff that matters.
Re:Python Cheat Sheet by clinth on Tuesday September 04, 2012 @06:21PM (#4476845)
Yes, but all objects are not iterables. If you list1.extend(object1) as the cheat sheet describes and object1 has no __iter__, it won't work. Likewise, you can iterate strings, so understanding the target of the iterable will be frustrating for list_of_strings.extend('newstring').

This is better described in python's native help documentation:

  $ python
  >>> help()
  >>> list
searching for extend via '/extend':

   |  extend(...)
   |      L.extend(iterable) -- extend list by appending elements from the iterable
Concise and correct.

There are no comments on this comment yet.