title: TypeError: NoneType object not iterable
body: <p>It might be silly question but I just started to learn OOP in Python and I am struggling to get this one:</p>
  
  <p>The following code works fine:</p>
  
  <pre><code>class Name(object):
      def __init__(self):
          self.name=None
  
  C1='Stephen Curry'
  C2='Kevin Durant'
  C3='LeBron James'
  C4='Chris Paul'
  
  
  nameList=[C1,C2,C3,C4]
  nameList.sort()
  for e in nameList:
      print (e)
  </code></pre>
  
  <p>However, when I use nameList.sort() inside the for loop, it gives me "TypeError: 'NoneType' object is not iterable"</p>
  
  <pre><code>class Name(object):
      def __init__(self):
          self.name=None
  
  C1='Stephen Curry'
  C2='Kevin Durant'
  C3='LeBron James'
  C4='Chris Paul'
  
  nameList=[C1,C2,C3,C4]
  
  for e in nameList.sort():
      print (e)
  </code></pre>
  
  <p>Thanks</p>