__init__.py 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. # Copyright (c) 2006-2011, 2013 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
  2. # Copyright (c) 2010 Daniel Harding <dharding@gmail.com>
  3. # Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com>
  4. # Copyright (c) 2014 Google, Inc.
  5. # Copyright (c) 2015-2016 Ceridwen <ceridwenv@gmail.com>
  6. # Copyright (c) 2016 Jared Garst <jgarst@users.noreply.github.com>
  7. # Copyright (c) 2017 Ashley Whetter <ashley@awhetter.co.uk>
  8. # Copyright (c) 2017 rr- <rr-@sakuya.pl>
  9. # Copyright (c) 2018 Bryce Guinta <bryce.paul.guinta@gmail.com>
  10. # Copyright (c) 2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
  11. # Copyright (c) 2021 Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
  12. # Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
  13. # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
  14. # For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
  15. """Every available node class.
  16. .. seealso::
  17. :doc:`ast documentation <green_tree_snakes:nodes>`
  18. All nodes inherit from :class:`~astroid.nodes.node_classes.NodeNG`.
  19. """
  20. # Nodes not present in the builtin ast module: DictUnpack, Unknown, and EvaluatedObject.
  21. from astroid.nodes.node_classes import ( # pylint: disable=redefined-builtin (Ellipsis)
  22. CONST_CLS,
  23. AnnAssign,
  24. Arguments,
  25. Assert,
  26. Assign,
  27. AssignAttr,
  28. AssignName,
  29. AsyncFor,
  30. AsyncWith,
  31. Attribute,
  32. AugAssign,
  33. Await,
  34. BaseContainer,
  35. BinOp,
  36. BoolOp,
  37. Break,
  38. Call,
  39. Compare,
  40. Comprehension,
  41. Const,
  42. Continue,
  43. Decorators,
  44. DelAttr,
  45. Delete,
  46. DelName,
  47. Dict,
  48. DictUnpack,
  49. Ellipsis,
  50. EmptyNode,
  51. EvaluatedObject,
  52. ExceptHandler,
  53. Expr,
  54. ExtSlice,
  55. For,
  56. FormattedValue,
  57. Global,
  58. If,
  59. IfExp,
  60. Import,
  61. ImportFrom,
  62. Index,
  63. JoinedStr,
  64. Keyword,
  65. List,
  66. Match,
  67. MatchAs,
  68. MatchCase,
  69. MatchClass,
  70. MatchMapping,
  71. MatchOr,
  72. MatchSequence,
  73. MatchSingleton,
  74. MatchStar,
  75. MatchValue,
  76. Name,
  77. NamedExpr,
  78. NodeNG,
  79. Nonlocal,
  80. Pass,
  81. Pattern,
  82. Raise,
  83. Return,
  84. Set,
  85. Slice,
  86. Starred,
  87. Statement,
  88. Subscript,
  89. TryExcept,
  90. TryFinally,
  91. Tuple,
  92. UnaryOp,
  93. Unknown,
  94. While,
  95. With,
  96. Yield,
  97. YieldFrom,
  98. are_exclusive,
  99. const_factory,
  100. unpack_infer,
  101. )
  102. from astroid.nodes.scoped_nodes import (
  103. AsyncFunctionDef,
  104. ClassDef,
  105. ComprehensionScope,
  106. DictComp,
  107. FunctionDef,
  108. GeneratorExp,
  109. Lambda,
  110. ListComp,
  111. LocalsDictNodeNG,
  112. Module,
  113. SetComp,
  114. builtin_lookup,
  115. function_to_method,
  116. get_wrapping_class,
  117. )
  118. _BaseContainer = BaseContainer # TODO Remove for astroid 3.0
  119. ALL_NODE_CLASSES = (
  120. _BaseContainer,
  121. BaseContainer,
  122. AnnAssign,
  123. Arguments,
  124. Assert,
  125. Assign,
  126. AssignAttr,
  127. AssignName,
  128. AsyncFor,
  129. AsyncFunctionDef,
  130. AsyncWith,
  131. Attribute,
  132. AugAssign,
  133. Await,
  134. BinOp,
  135. BoolOp,
  136. Break,
  137. Call,
  138. ClassDef,
  139. Compare,
  140. Comprehension,
  141. ComprehensionScope,
  142. Const,
  143. const_factory,
  144. Continue,
  145. Decorators,
  146. DelAttr,
  147. Delete,
  148. DelName,
  149. Dict,
  150. DictComp,
  151. DictUnpack,
  152. Ellipsis,
  153. EmptyNode,
  154. EvaluatedObject,
  155. ExceptHandler,
  156. Expr,
  157. ExtSlice,
  158. For,
  159. FormattedValue,
  160. FunctionDef,
  161. GeneratorExp,
  162. Global,
  163. If,
  164. IfExp,
  165. Import,
  166. ImportFrom,
  167. Index,
  168. JoinedStr,
  169. Keyword,
  170. Lambda,
  171. List,
  172. ListComp,
  173. LocalsDictNodeNG,
  174. Match,
  175. MatchAs,
  176. MatchCase,
  177. MatchClass,
  178. MatchMapping,
  179. MatchOr,
  180. MatchSequence,
  181. MatchSingleton,
  182. MatchStar,
  183. MatchValue,
  184. Module,
  185. Name,
  186. NamedExpr,
  187. NodeNG,
  188. Nonlocal,
  189. Pass,
  190. Pattern,
  191. Raise,
  192. Return,
  193. Set,
  194. SetComp,
  195. Slice,
  196. Starred,
  197. Subscript,
  198. TryExcept,
  199. TryFinally,
  200. Tuple,
  201. UnaryOp,
  202. Unknown,
  203. While,
  204. With,
  205. Yield,
  206. YieldFrom,
  207. )
  208. __all__ = (
  209. "AnnAssign",
  210. "are_exclusive",
  211. "Arguments",
  212. "Assert",
  213. "Assign",
  214. "AssignAttr",
  215. "AssignName",
  216. "AsyncFor",
  217. "AsyncFunctionDef",
  218. "AsyncWith",
  219. "Attribute",
  220. "AugAssign",
  221. "Await",
  222. "BinOp",
  223. "BoolOp",
  224. "Break",
  225. "builtin_lookup",
  226. "Call",
  227. "ClassDef",
  228. "CONST_CLS",
  229. "Compare",
  230. "Comprehension",
  231. "ComprehensionScope",
  232. "Const",
  233. "const_factory",
  234. "Continue",
  235. "Decorators",
  236. "DelAttr",
  237. "Delete",
  238. "DelName",
  239. "Dict",
  240. "DictComp",
  241. "DictUnpack",
  242. "Ellipsis",
  243. "EmptyNode",
  244. "EvaluatedObject",
  245. "ExceptHandler",
  246. "Expr",
  247. "ExtSlice",
  248. "For",
  249. "FormattedValue",
  250. "FunctionDef",
  251. "function_to_method",
  252. "GeneratorExp",
  253. "get_wrapping_class",
  254. "Global",
  255. "If",
  256. "IfExp",
  257. "Import",
  258. "ImportFrom",
  259. "Index",
  260. "JoinedStr",
  261. "Keyword",
  262. "Lambda",
  263. "List",
  264. "ListComp",
  265. "LocalsDictNodeNG",
  266. "Match",
  267. "MatchAs",
  268. "MatchCase",
  269. "MatchClass",
  270. "MatchMapping",
  271. "MatchOr",
  272. "MatchSequence",
  273. "MatchSingleton",
  274. "MatchStar",
  275. "MatchValue",
  276. "Module",
  277. "Name",
  278. "NamedExpr",
  279. "NodeNG",
  280. "Nonlocal",
  281. "Pass",
  282. "Raise",
  283. "Return",
  284. "Set",
  285. "SetComp",
  286. "Slice",
  287. "Starred",
  288. "Statement",
  289. "Subscript",
  290. "TryExcept",
  291. "TryFinally",
  292. "Tuple",
  293. "UnaryOp",
  294. "Unknown",
  295. "unpack_infer",
  296. "While",
  297. "With",
  298. "Yield",
  299. "YieldFrom",
  300. )