99_bugs.py 371 B

123456789101112131415161718192021
  1. # https://github.com/blueloveTH/pocketpy/issues/37
  2. mp = map(lambda x: x**2, [1, 2, 3, 4, 5] )
  3. assert list(mp) == [1, 4, 9, 16, 25]
  4. assert not 3>4
  5. def f(x):
  6. if x>1:
  7. return 1
  8. assert f(2) == 1
  9. assert f(0) == None
  10. a = [1, 2]
  11. b = [3, 4]
  12. assert a.append == a.append
  13. assert a.append is not a.append
  14. assert a.append is not b.append
  15. assert a.append != b.append