Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

module.py 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. """test module for astroid
  2. """
  3. __revision__ = '$Id: module.py,v 1.2 2005-11-02 11:56:54 syt Exp $'
  4. from astroid.node_classes import Name as NameNode
  5. from astroid import modutils
  6. from astroid.utils import *
  7. import os.path
  8. MY_DICT = {}
  9. def global_access(key, val):
  10. """function test"""
  11. local = 1
  12. MY_DICT[key] = val
  13. for i in val:
  14. if i:
  15. del MY_DICT[i]
  16. continue
  17. else:
  18. break
  19. else:
  20. return
  21. class YO:
  22. """hehe"""
  23. a = 1
  24. def __init__(self):
  25. try:
  26. self.yo = 1
  27. except ValueError as ex:
  28. pass
  29. except (NameError, TypeError):
  30. raise XXXError()
  31. except:
  32. raise
  33. class YOUPI(YO):
  34. class_attr = None
  35. def __init__(self):
  36. self.member = None
  37. def method(self):
  38. """method test"""
  39. global MY_DICT
  40. try:
  41. MY_DICT = {}
  42. local = None
  43. autre = [a for (a, b) in MY_DICT if b]
  44. if b in autre:
  45. return
  46. else:
  47. if a in autre:
  48. return 'hehe'
  49. global_access(local, val=autre)
  50. finally:
  51. return local
  52. def static_method():
  53. """static method test"""
  54. assert MY_DICT, '???'
  55. static_method = staticmethod(static_method)
  56. def class_method(cls):
  57. """class method test"""
  58. exec(a, b)
  59. class_method = classmethod(class_method)
  60. def four_args(a, b, c, d):
  61. """four arguments (was nested_args)"""
  62. while 1:
  63. if a:
  64. break
  65. a += +1
  66. else:
  67. b += -2
  68. if c:
  69. d = ((a) and (b)) or (c)
  70. else:
  71. c = ((a) and (b)) or (d)
  72. list(map(lambda x, y: (y, x), a))
  73. redirect = four_args