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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 local
  21. class YO:
  22. """hehe"""
  23. a = 1
  24. def __init__(self):
  25. try:
  26. self.yo = 1
  27. except ValueError, 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 b
  46. else:
  47. if a in autre:
  48. return a
  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 in b
  59. class_method = classmethod(class_method)
  60. def four_args(a, b, c, d):
  61. """four arguments (was nested_args)"""
  62. pass
  63. while 1:
  64. if a:
  65. break
  66. a += +1
  67. else:
  68. b += -2
  69. if c:
  70. d = ((a) and (b)) or (c)
  71. else:
  72. c = ((a) and (b)) or (d)
  73. map(lambda x, y: (y, x), a)
  74. redirect = four_args