99_bugs.py 504 B

1234567891011121314151617181920212223242526272829303132
  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
  16. inq = 0
  17. if not inq:
  18. assert True
  19. else:
  20. assert False
  21. if inq is not 1:
  22. assert True
  23. if inq is not 0:
  24. assert False