E72.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #: E721:3
  2. if type(res) == type(42):
  3. pass
  4. #: E721:3
  5. if type(res) != type(""):
  6. pass
  7. import types
  8. if res == types.IntType:
  9. pass
  10. import types
  11. #: E721:3
  12. if type(res) is not types.ListType:
  13. pass
  14. #: E721:7 E721:35
  15. assert type(res) == type(False) or type(res) == type(None)
  16. #: E721:7
  17. assert type(res) == type([])
  18. #: E721:7
  19. assert type(res) == type(())
  20. #: E721:7
  21. assert type(res) == type((0,))
  22. #: E721:7
  23. assert type(res) == type((0))
  24. #: E721:7
  25. assert type(res) != type((1,))
  26. #: E721:7
  27. assert type(res) is type((1,))
  28. #: E721:7
  29. assert type(res) is not type((1,))
  30. # Okay
  31. #: E402
  32. import types
  33. if isinstance(res, int):
  34. pass
  35. if isinstance(res, str):
  36. pass
  37. if isinstance(res, types.MethodType):
  38. pass
  39. #: E721:3 E721:25
  40. if type(a) != type(b) or type(a) == type(ccc):
  41. pass
  42. #: E721
  43. type(a) != type(b)
  44. #: E721
  45. 1 != type(b)
  46. #: E721
  47. type(b) != 1
  48. 1 != 1
  49. try:
  50. pass
  51. #: E722
  52. except:
  53. pass
  54. try:
  55. pass
  56. except Exception:
  57. pass
  58. #: E722
  59. except:
  60. pass
  61. # Okay
  62. fake_code = """"
  63. try:
  64. do_something()
  65. except:
  66. pass
  67. """
  68. try:
  69. pass
  70. except Exception:
  71. pass