Skip to content

Instantly share code, notes, and snippets.

@plq
Created August 6, 2013 11:52
Show Gist options
  • Select an option

  • Save plq/6163839 to your computer and use it in GitHub Desktop.

Select an option

Save plq/6163839 to your computer and use it in GitHub Desktop.
Traceback (most recent call last):
File "sample.py", line 8, in <module>
print list(sq_all(l))
File "sample.py", line 4, in sq_all
yield x*x
TypeError: unsupported operand type(s) for *: 'NoneType' and 'NoneType'
def sq_all(l):
for x in l:
yield x*x
l = [1,2,3,4,None,6,7,8]
print list(sq_all(l))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment