__init__.py 5.0 KB

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