__init__.py 4.7 KB

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