astroid 4.2.0b2__tar.gz → 4.2.0b4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. {astroid-4.2.0b2 → astroid-4.2.0b4}/CONTRIBUTORS.txt +15 -5
  2. {astroid-4.2.0b2/astroid.egg-info → astroid-4.2.0b4}/PKG-INFO +2 -2
  3. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/__pkginfo__.py +1 -1
  4. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/bases.py +3 -7
  5. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_builtin_inference.py +31 -10
  6. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_dataclasses.py +21 -4
  7. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_functools.py +2 -0
  8. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_gi.py +5 -3
  9. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_multiprocessing.py +4 -0
  10. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_namedtuple_enum.py +14 -2
  11. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_core_umath.py +3 -3
  12. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_random.py +6 -1
  13. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/context.py +2 -1
  14. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/decorators.py +2 -4
  15. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/exceptions.py +1 -2
  16. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/helpers.py +7 -4
  17. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/inference_tip.py +3 -10
  18. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/interpreter/_import/util.py +4 -4
  19. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/interpreter/dunder_lookup.py +3 -1
  20. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/interpreter/objectmodel.py +15 -9
  21. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/modutils.py +13 -13
  22. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/_base_nodes.py +4 -1
  23. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/as_string.py +17 -16
  24. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/const.py +1 -0
  25. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/node_classes.py +58 -88
  26. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/node_ng.py +6 -6
  27. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/scoped_nodes/scoped_nodes.py +23 -14
  28. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/objects.py +36 -21
  29. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/protocols.py +35 -9
  30. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/raw_building.py +28 -19
  31. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/rebuilder.py +32 -20
  32. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/typing.py +0 -2
  33. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/util.py +4 -2
  34. {astroid-4.2.0b2 → astroid-4.2.0b4/astroid.egg-info}/PKG-INFO +2 -2
  35. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid.egg-info/SOURCES.txt +3 -0
  36. {astroid-4.2.0b2 → astroid-4.2.0b4}/pyproject.toml +9 -7
  37. astroid-4.2.0b4/requirements_full.txt +16 -0
  38. {astroid-4.2.0b2 → astroid-4.2.0b4}/requirements_minimal.txt +2 -2
  39. astroid-4.2.0b4/tests/benchmarks/conftest.py +18 -0
  40. astroid-4.2.0b4/tests/benchmarks/test_bench_endtoend.py +202 -0
  41. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_core_function_base.py +1 -3
  42. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_core_multiarray.py +10 -30
  43. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_core_numeric.py +1 -3
  44. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_core_umath.py +1 -3
  45. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_brain.py +92 -0
  46. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_dataclasses.py +30 -5
  47. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_enum.py +28 -1
  48. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_multiprocessing.py +21 -0
  49. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_helpers.py +26 -1
  50. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_inference.py +84 -1
  51. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_manager.py +76 -7
  52. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_nodes.py +40 -2
  53. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_nodes_position.py +47 -0
  54. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_protocols.py +91 -15
  55. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_raw_building.py +24 -0
  56. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_scoped_nodes.py +59 -0
  57. astroid-4.2.0b4/tests/testdata/python3/pyi_data/module.py +0 -0
  58. astroid-4.2.0b2/requirements_full.txt +0 -14
  59. {astroid-4.2.0b2 → astroid-4.2.0b4}/LICENSE +0 -0
  60. {astroid-4.2.0b2 → astroid-4.2.0b4}/MANIFEST.in +0 -0
  61. {astroid-4.2.0b2 → astroid-4.2.0b4}/README.rst +0 -0
  62. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/__init__.py +0 -0
  63. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/__main__.py +0 -0
  64. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/_ast.py +0 -0
  65. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/arguments.py +0 -0
  66. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/astroid_manager.py +0 -0
  67. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/__init__.py +0 -0
  68. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_argparse.py +0 -0
  69. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_attrs.py +0 -0
  70. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_boto3.py +0 -0
  71. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_collections.py +0 -0
  72. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_crypt.py +0 -0
  73. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_ctypes.py +0 -0
  74. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_curses.py +0 -0
  75. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_datetime.py +0 -0
  76. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_dateutil.py +0 -0
  77. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_hashlib.py +0 -0
  78. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_http.py +0 -0
  79. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_hypothesis.py +0 -0
  80. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_io.py +0 -0
  81. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_mechanize.py +0 -0
  82. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_core_einsumfunc.py +0 -0
  83. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_core_fromnumeric.py +0 -0
  84. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_core_function_base.py +0 -0
  85. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_core_multiarray.py +0 -0
  86. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_core_numeric.py +0 -0
  87. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_core_numerictypes.py +0 -0
  88. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_ma.py +0 -0
  89. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_ndarray.py +0 -0
  90. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_random_mtrand.py +0 -0
  91. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_numpy_utils.py +0 -0
  92. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_pathlib.py +0 -0
  93. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_pkg_resources.py +0 -0
  94. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_pytest.py +0 -0
  95. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_qt.py +0 -0
  96. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_re.py +0 -0
  97. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_regex.py +0 -0
  98. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_responses.py +0 -0
  99. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_scipy_signal.py +0 -0
  100. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_signal.py +0 -0
  101. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_six.py +0 -0
  102. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_sqlalchemy.py +0 -0
  103. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_ssl.py +0 -0
  104. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_statistics.py +0 -0
  105. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_subprocess.py +0 -0
  106. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_threading.py +0 -0
  107. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_type.py +0 -0
  108. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_typing.py +0 -0
  109. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_unittest.py +0 -0
  110. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/brain_uuid.py +0 -0
  111. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/brain/helpers.py +0 -0
  112. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/builder.py +0 -0
  113. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/const.py +0 -0
  114. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/constraint.py +0 -0
  115. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/filter_statements.py +0 -0
  116. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/interpreter/__init__.py +0 -0
  117. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/interpreter/_import/__init__.py +0 -0
  118. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/interpreter/_import/spec.py +0 -0
  119. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/manager.py +0 -0
  120. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/__init__.py +0 -0
  121. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/scoped_nodes/__init__.py +0 -0
  122. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/scoped_nodes/mixin.py +0 -0
  123. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/scoped_nodes/utils.py +0 -0
  124. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/nodes/utils.py +0 -0
  125. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/test_utils.py +0 -0
  126. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid/transforms.py +0 -0
  127. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid.egg-info/dependency_links.txt +0 -0
  128. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid.egg-info/requires.txt +0 -0
  129. {astroid-4.2.0b2 → astroid-4.2.0b4}/astroid.egg-info/top_level.txt +0 -0
  130. {astroid-4.2.0b2 → astroid-4.2.0b4}/requirements_dev.txt +0 -0
  131. {astroid-4.2.0b2 → astroid-4.2.0b4}/setup.cfg +0 -0
  132. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/__init__.py +0 -0
  133. {astroid-4.2.0b2/tests/brain → astroid-4.2.0b4/tests/benchmarks}/__init__.py +0 -0
  134. {astroid-4.2.0b2/tests/brain/numpy → astroid-4.2.0b4/tests/brain}/__init__.py +0 -0
  135. {astroid-4.2.0b2/tests/testdata/python3/data/beyond_top_level_three/double_name → astroid-4.2.0b4/tests/brain/numpy}/__init__.py +0 -0
  136. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_core_einsumfunc.py +0 -0
  137. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_core_fromnumeric.py +0 -0
  138. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_core_numerictypes.py +0 -0
  139. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_ma.py +0 -0
  140. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_ndarray.py +0 -0
  141. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/numpy/test_random_mtrand.py +0 -0
  142. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_argparse.py +0 -0
  143. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_attr.py +0 -0
  144. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_builtin.py +0 -0
  145. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_ctypes.py +0 -0
  146. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_dateutil.py +0 -0
  147. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_gi.py +0 -0
  148. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_hashlib.py +0 -0
  149. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_helpers.py +0 -0
  150. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_named_tuple.py +0 -0
  151. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_pathlib.py +0 -0
  152. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_pytest.py +0 -0
  153. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_qt.py +0 -0
  154. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_regex.py +0 -0
  155. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_signal.py +0 -0
  156. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_six.py +0 -0
  157. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_ssl.py +0 -0
  158. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_statistics.py +0 -0
  159. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_threading.py +0 -0
  160. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_typing.py +0 -0
  161. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_typing_extensions.py +0 -0
  162. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/brain/test_unittest.py +0 -0
  163. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/resources.py +0 -0
  164. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_builder.py +0 -0
  165. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_constraint.py +0 -0
  166. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_decorators.py +0 -0
  167. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_filter_statements.py +0 -0
  168. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_get_relative_base_path.py +0 -0
  169. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_group_exceptions.py +0 -0
  170. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_inference_calls.py +0 -0
  171. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_lookup.py +0 -0
  172. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_modutils.py +0 -0
  173. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_nodes_lineno.py +0 -0
  174. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_object_model.py +0 -0
  175. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_objects.py +0 -0
  176. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_python3.py +0 -0
  177. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_regrtest.py +0 -0
  178. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_stdlib.py +0 -0
  179. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_transforms.py +0 -0
  180. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_type_params.py +0 -0
  181. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/test_utils.py +0 -0
  182. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/MyPyPa-0.1.0-py2.5.egg +0 -0
  183. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/MyPyPa-0.1.0-py2.5.zip +0 -0
  184. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/SSL1/Connection1.py +0 -0
  185. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/SSL1/__init__.py +0 -0
  186. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/__init__.py +0 -0
  187. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/absimp/__init__.py +0 -0
  188. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/absimp/sidepackage/__init__.py +0 -0
  189. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/absimp/string.py +0 -0
  190. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/absimport.py +0 -0
  191. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/all.py +0 -0
  192. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/appl/__init__.py +0 -0
  193. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/appl/myConnection.py +0 -0
  194. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level/import_package.py +0 -0
  195. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level/namespace_package/lower_level/helper_function.py +0 -0
  196. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level/namespace_package/plugin_api.py +0 -0
  197. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level/namespace_package/top_level_function.py +0 -0
  198. {astroid-4.2.0b2/tests/testdata/python3/data/beyond_top_level_three/module → astroid-4.2.0b4/tests/testdata/python3/data/beyond_top_level_three/double_name}/__init__.py +0 -0
  199. {astroid-4.2.0b2/tests/testdata/python3/data/beyond_top_level_three/module/double_name → astroid-4.2.0b4/tests/testdata/python3/data/beyond_top_level_three/module}/__init__.py +0 -0
  200. {astroid-4.2.0b2/tests/testdata/python3/data/beyond_top_level_three/module/sub_module → astroid-4.2.0b4/tests/testdata/python3/data/beyond_top_level_three/module/double_name}/__init__.py +0 -0
  201. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level_three/module/double_name/function.py +0 -0
  202. {astroid-4.2.0b2/tests/testdata/python3/data/beyond_top_level_three/module/sub_module/sub_sub_module → astroid-4.2.0b4/tests/testdata/python3/data/beyond_top_level_three/module/sub_module}/__init__.py +0 -0
  203. {astroid-4.2.0b2/tests/testdata/python3/data/beyond_top_level_two → astroid-4.2.0b4/tests/testdata/python3/data/beyond_top_level_three/module/sub_module/sub_sub_module}/__init__.py +0 -0
  204. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level_three/module/sub_module/sub_sub_module/main.py +0 -0
  205. {astroid-4.2.0b2/tests/testdata/python3/data/cache → astroid-4.2.0b4/tests/testdata/python3/data/beyond_top_level_two}/__init__.py +0 -0
  206. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level_two/a.py +0 -0
  207. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level_two/level1/__init__.py +0 -0
  208. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/beyond_top_level_two/level1/beyond_top_level_two.py +0 -0
  209. {astroid-4.2.0b2/tests/testdata/python3/data/find_test → astroid-4.2.0b4/tests/testdata/python3/data/cache}/__init__.py +0 -0
  210. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/cache/a.py +0 -0
  211. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/conditional.py +0 -0
  212. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/conditional_import/__init__.py +0 -0
  213. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/contribute_to_namespace/namespace_pep_420/submodule.py +0 -0
  214. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/descriptor_crash.py +0 -0
  215. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/divide_by_zero.py +0 -0
  216. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/email.py +0 -0
  217. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/fake_module_with_broken_getattr.py +0 -0
  218. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/fake_module_with_collection_getattribute.py +0 -0
  219. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/fake_module_with_warnings.py +0 -0
  220. {astroid-4.2.0b2/tests/testdata/python3/data/foogle/fax → astroid-4.2.0b4/tests/testdata/python3/data/find_test}/__init__.py +0 -0
  221. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/find_test/module.py +0 -0
  222. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/find_test/module2.py +0 -0
  223. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/find_test/noendingnewline.py +0 -0
  224. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/find_test/nonregr.py +0 -0
  225. {astroid-4.2.0b2/tests/testdata/python3/data/metaclass_recursion → astroid-4.2.0b4/tests/testdata/python3/data/foogle/fax}/__init__.py +0 -0
  226. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/foogle/fax/a.py +0 -0
  227. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/foogle_fax-0.12.5-py2.7-nspkg.pth +0 -0
  228. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/format.py +0 -0
  229. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/import_conflicting_names/math.py +0 -0
  230. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/import_setuptools_pep660/__editable___example_0_1_0_finder.py +0 -0
  231. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/import_setuptools_pep660/example/__init__.py +0 -0
  232. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/import_setuptools_pep660/example/subpackage/__init__.py +0 -0
  233. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/invalid_encoding.py +0 -0
  234. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/lmfp/__init__.py +0 -0
  235. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/lmfp/foo.py +0 -0
  236. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/max_inferable_limit_for_classes/main.py +0 -0
  237. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/max_inferable_limit_for_classes/nodes/roles.py +0 -0
  238. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/max_inferable_limit_for_classes/other_funcs.py +0 -0
  239. {astroid-4.2.0b2/tests/testdata/python3/data/parent_of_homonym → astroid-4.2.0b4/tests/testdata/python3/data/metaclass_recursion}/__init__.py +0 -0
  240. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/metaclass_recursion/monkeypatch.py +0 -0
  241. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/metaclass_recursion/parent.py +0 -0
  242. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/module.py +0 -0
  243. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/module1abs/__init__.py +0 -0
  244. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/module1abs/core.py +0 -0
  245. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/module2.py +0 -0
  246. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/module3.14.py +0 -0
  247. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/module_dict_items_call/models.py +0 -0
  248. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/module_dict_items_call/test.py +0 -0
  249. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/namespace_pep_420/module.py +0 -0
  250. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/noendingnewline.py +0 -0
  251. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/nonregr.py +0 -0
  252. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/notall.py +0 -0
  253. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/notamodule/file.py +0 -0
  254. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/operator_precedence.py +0 -0
  255. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/package/__init__.py +0 -0
  256. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/package/absimport.py +0 -0
  257. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/package/hello.py +0 -0
  258. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/package/import_package_subpackage_module.py +0 -0
  259. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/package/subpackage/__init__.py +0 -0
  260. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/package/subpackage/module.py +0 -0
  261. {astroid-4.2.0b2/tests/testdata/python3/data/parent_of_homonym/doc → astroid-4.2.0b4/tests/testdata/python3/data/parent_of_homonym}/__init__.py +0 -0
  262. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/parent_of_homonym/doc/README.md +0 -0
  263. {astroid-4.2.0b2/tests/testdata/python3/data/unicode_package/core → astroid-4.2.0b4/tests/testdata/python3/data/parent_of_homonym/doc}/__init__.py +0 -0
  264. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkg_resources_1/package/__init__.py +0 -0
  265. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkg_resources_1/package/foo.py +0 -0
  266. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkg_resources_2/package/__init__.py +0 -0
  267. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkg_resources_2/package/bar.py +0 -0
  268. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkg_resources_3/package/__init__.py +0 -0
  269. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkg_resources_3/package/baz.py +0 -0
  270. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkgutil_1/package/__init__.py +0 -0
  271. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkgutil_1/package/foo.py +0 -0
  272. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkgutil_2/package/__init__.py +0 -0
  273. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkgutil_2/package/bar.py +0 -0
  274. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkgutil_3/package/__init__.py +0 -0
  275. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/path_pkgutil_3/package/baz.py +0 -0
  276. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/recursion.py +0 -0
  277. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/tmp__init__.py +0 -0
  278. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/unicode_package/__init__.py +0 -0
  279. {astroid-4.2.0b2/tests/testdata/python3/pyi_data/find_test → astroid-4.2.0b4/tests/testdata/python3/data/unicode_package/core}/__init__.py +0 -0
  280. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/data/x.zip +0 -0
  281. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/pyi_data/__init__.pyi +0 -0
  282. /astroid-4.2.0b2/tests/testdata/python3/pyi_data/find_test/__init__.pyi → /astroid-4.2.0b4/tests/testdata/python3/pyi_data/find_test/__init__.py +0 -0
  283. /astroid-4.2.0b2/tests/testdata/python3/pyi_data/find_test/__init__.weird_ext → /astroid-4.2.0b4/tests/testdata/python3/pyi_data/find_test/__init__.pyi +0 -0
  284. /astroid-4.2.0b2/tests/testdata/python3/pyi_data/find_test/module.py → /astroid-4.2.0b4/tests/testdata/python3/pyi_data/find_test/__init__.weird_ext +0 -0
  285. {astroid-4.2.0b2/tests/testdata/python3/pyi_data → astroid-4.2.0b4/tests/testdata/python3/pyi_data/find_test}/module.py +0 -0
  286. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/pyi_data/find_test/module2.py +0 -0
  287. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/pyi_data/find_test/noendingnewline.py +0 -0
  288. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/pyi_data/find_test/nonregr.py +0 -0
  289. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/pyi_data/find_test/standalone_file.weird_ext +0 -0
  290. {astroid-4.2.0b2 → astroid-4.2.0b4}/tests/testdata/python3/recursion_error.py +0 -0
  291. {astroid-4.2.0b2 → astroid-4.2.0b4}/tox.ini +0 -0
@@ -38,8 +38,8 @@ Contributors
38
38
  - Artem Yurchenko <44875844+temyurchenko@users.noreply.github.com>
39
39
  - David Liu <david@cs.toronto.edu>
40
40
  - Alexandre Fayolle <alexandre.fayolle@logilab.fr>
41
- - Eevee (Alex Munroe) <amunroe@yelp.com>
42
41
  - Emmanuel Ferdman <emmanuelferdman@gmail.com>
42
+ - Eevee (Alex Munroe) <amunroe@yelp.com>
43
43
  - David Gilman <davidgilman1@gmail.com>
44
44
  - Zen Lee <53538590+zenlyj@users.noreply.github.com>
45
45
  - Tushar Sadhwani <tushar.sadhwani000@gmail.com>
@@ -48,6 +48,7 @@ Contributors
48
48
  - Hugo van Kemenade <hugovk@users.noreply.github.com>
49
49
  - Calen Pennington <calen.pennington@gmail.com>
50
50
  - Antonio <antonio@zoftko.com>
51
+ - Fridayworks <aifriday700@gmail.com>
51
52
  - Akhil Kamat <akhil.kamat@gmail.com>
52
53
  - Tim Martin <tim@asymptotic.co.uk>
53
54
  - Phil Schaf <flying-sheep@web.de>
@@ -75,6 +76,7 @@ Contributors
75
76
  - Enji Cooper <yaneurabeya@gmail.com>
76
77
  - Dani Alcala <112832187+clavedeluna@users.noreply.github.com>
77
78
  - Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
79
+ - Vincent Gao <gaobing1230@gmail.com>
78
80
  - tristanlatr <19967168+tristanlatr@users.noreply.github.com>
79
81
  - grayjk <grayjk@gmail.com>
80
82
  - emile@crater.logilab.fr <emile@crater.logilab.fr>
@@ -106,12 +108,13 @@ Contributors
106
108
  - David Euresti <github@euresti.com>
107
109
  - David Douard <david.douard@logilab.fr>
108
110
  - David Cain <davidjosephcain@gmail.com>
111
+ - Casey Jones <731937+doctorcolossus@users.noreply.github.com>
109
112
  - Anthony Truchet <anthony.truchet@logilab.fr>
110
113
  - Anthony Sottile <asottile@umich.edu>
111
114
  - Alexander Shadchin <alexandr.shadchin@gmail.com>
112
- - Fridayworks <aifriday700@gmail.com>
113
115
  - wgehalo <wgehalo@gmail.com>
114
116
  - tejaschauhan36912 <59693377+tejaschauhan36912@users.noreply.github.com>
117
+ - sergiochan <yuheng9211@qq.com>
115
118
  - rr- <rr-@sakuya.pl>
116
119
  - raylu <lurayl@gmail.com>
117
120
  - plucury <plucury@gmail.com>
@@ -122,6 +125,7 @@ Contributors
122
125
  - mathieui <mathieui@users.noreply.github.com>
123
126
  - markmcclain <markmcclain@users.noreply.github.com>
124
127
  - jkmnt <git@firewood.fastmail.com>
128
+ - Sai Asish Y <say.apm35@gmail.com>
125
129
  - ioanatia <ioanatia@users.noreply.github.com>
126
130
  - alm <alonme@users.noreply.github.com>
127
131
  - adam-grant-hendry <59346180+adam-grant-hendry@users.noreply.github.com>
@@ -163,6 +167,7 @@ Contributors
163
167
  - Jörg Thalheim <Mic92@users.noreply.github.com>
164
168
  - Jérome Perrin <perrinjerome@gmail.com>
165
169
  - JulianJvn <128477611+JulianJvn@users.noreply.github.com>
170
+ - Joshix-1 <57299889+Joshix-1@users.noreply.github.com>
166
171
  - Josef Kemetmüller <josef.kemetmueller@gmail.com>
167
172
  - Jonathan Striebel <jstriebel@users.noreply.github.com>
168
173
  - John Belmonte <john@neggie.net>
@@ -220,9 +225,14 @@ Contributors
220
225
  - Alexander Scheel <alexander.m.scheel@gmail.com>
221
226
  - Alexander Presnyakov <flagist0@gmail.com>
222
227
  - Ahmed Azzaoui <ahmed.azzaoui@engie.com>
223
- - Casey Jones <731937+doctorcolossus@users.noreply.github.com>
224
- - sergiochan <yuheng9211@qq.com>
225
- - Joshix-1 <57299889+Joshix-1@users.noreply.github.com>
228
+ - nanookclaw <nanook@agentmail.to>
229
+ - SAY-5 <say.apm35@gmail.com>
230
+ - Omkar Kabde <omkarkabde@gmail.com>
231
+ - MJSHANG <shangmengjiajiajia@gmail.com>
232
+ - Kyle D Kavanagh <kkavanagh@jumptrading.com>
233
+ - KALI 834X <kali834x@gmail.com>
234
+ - June <kimjune01@gmail.com>
235
+ - Jam Balaya <jambalaya.pyoncafe@outlook.jp>
226
236
 
227
237
  Co-Author
228
238
  ---------
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astroid
3
- Version: 4.2.0b2
3
+ Version: 4.2.0b4
4
4
  Summary: An abstract syntax tree for Python with inference support.
5
5
  License-Expression: LGPL-2.1-or-later
6
6
  Project-URL: Bug tracker, https://github.com/pylint-dev/astroid/issues
7
7
  Project-URL: Discord server, https://discord.gg/Egy6P8AMB5
8
- Project-URL: Source Code, https://github.com/pylint-dev/astroid
9
8
  Project-URL: Docs, https://pylint.readthedocs.io/projects/astroid/en/latest/
9
+ Project-URL: Source Code, https://github.com/pylint-dev/astroid
10
10
  Keywords: abstract syntax tree,python,static code analysis
11
11
  Classifier: Development Status :: 6 - Mature
12
12
  Classifier: Environment :: Console
@@ -2,5 +2,5 @@
2
2
  # For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE
3
3
  # Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt
4
4
 
5
- __version__ = "4.2.0b2"
5
+ __version__ = "4.2.0b4"
6
6
  version = __version__
@@ -146,7 +146,7 @@ class Proxy:
146
146
  return getattr(self._proxied, name)
147
147
 
148
148
  def infer( # type: ignore[return]
149
- self, context: InferenceContext | None = None, **kwargs: Any
149
+ self, context: InferenceContext | None = None
150
150
  ) -> collections.abc.Generator[InferenceResult, None, InferenceErrorInfo | None]:
151
151
  yield self
152
152
 
@@ -371,9 +371,7 @@ class Instance(BaseInstance):
371
371
  return method.infer_call_result(self, context)
372
372
 
373
373
  def __repr__(self) -> str:
374
- return "<Instance of {}.{} at 0x{}>".format(
375
- self._proxied.root().name, self._proxied.name, id(self)
376
- )
374
+ return f"<Instance of {self._proxied.root().name}.{self._proxied.name} at 0x{id(self)}>"
377
375
 
378
376
  def __str__(self) -> str:
379
377
  return f"Instance of {self._proxied.root().name}.{self._proxied.name}"
@@ -453,9 +451,7 @@ class UnboundMethod(Proxy):
453
451
  def __repr__(self) -> str:
454
452
  assert self._proxied.parent, "Expected a parent node"
455
453
  frame = self._proxied.parent.frame()
456
- return "<{} {} of {} at 0x{}".format(
457
- self.__class__.__name__, self._proxied.name, frame.qname(), id(self)
458
- )
454
+ return f"<{self.__class__.__name__} {self._proxied.name} of {frame.qname()} at 0x{id(self)}"
459
455
 
460
456
  def implicit_parameters(self) -> Literal[0, 1]:
461
457
  return 0
@@ -9,7 +9,7 @@ from __future__ import annotations
9
9
  import itertools
10
10
  from collections.abc import Callable, Iterable, Iterator
11
11
  from functools import partial
12
- from typing import TYPE_CHECKING, Any, NoReturn, cast
12
+ from typing import TYPE_CHECKING, NoReturn, cast
13
13
 
14
14
  from astroid import arguments, helpers, nodes, objects, util
15
15
  from astroid.builder import AstroidBuilder
@@ -199,7 +199,7 @@ def register_builtin_transform(
199
199
  """
200
200
 
201
201
  def _transform_wrapper(
202
- node: nodes.Call, context: InferenceContext | None = None, **kwargs: Any
202
+ node: nodes.Call, context: InferenceContext | None = None
203
203
  ) -> Iterator:
204
204
  result = transform(node, context=context)
205
205
  if result:
@@ -710,7 +710,8 @@ def infer_slice(node, context: InferenceContext | None = None):
710
710
 
711
711
 
712
712
  def _infer_object__new__decorator(
713
- node: nodes.ClassDef, context: InferenceContext | None = None, **kwargs: Any
713
+ node: nodes.ClassDef,
714
+ context: InferenceContext | None = None,
714
715
  ) -> Iterator[Instance]:
715
716
  # Instantiate class immediately
716
717
  # since that's what @object.__new__ does
@@ -827,7 +828,7 @@ def infer_len(node, context: InferenceContext | None = None) -> nodes.Const:
827
828
  if len(call.positional_arguments) != 1:
828
829
  raise UseInferenceDefault(
829
830
  "TypeError: len() must take exactly one argument "
830
- "({len}) given".format(len=len(call.positional_arguments))
831
+ f"({len(call.positional_arguments)}) given"
831
832
  )
832
833
  [argument_node] = call.positional_arguments
833
834
 
@@ -842,15 +843,35 @@ def infer_str(node, context: InferenceContext | None = None) -> nodes.Const:
842
843
 
843
844
  :param nodes.Call node: str() call to infer
844
845
  :param context.InferenceContext: node context
845
- :rtype nodes.Const: a Const containing an empty string
846
+ :rtype nodes.Const:
847
+ a Const containing a stringified value of str() call if possible, else an empty string
846
848
  """
847
849
  call = arguments.CallSite.from_call(node, context=context)
848
850
  if call.keyword_arguments:
849
851
  raise UseInferenceDefault("TypeError: str() must take no keyword arguments")
852
+
853
+ fallback = nodes.Const("")
854
+
855
+ if not call.positional_arguments:
856
+ return fallback
857
+
858
+ # Accept only if all inferred values resolve to the same string
859
+ candidates: set[str] = set()
850
860
  try:
851
- return nodes.Const("")
852
- except (AstroidTypeError, InferenceError) as exc:
853
- raise UseInferenceDefault(str(exc)) from exc
861
+ for inferred in call.positional_arguments[0].infer(context=context):
862
+ if not isinstance(inferred, nodes.Const):
863
+ return fallback
864
+
865
+ try:
866
+ candidates.add(str(inferred.value))
867
+ except ValueError:
868
+ return fallback
869
+ except InferenceError:
870
+ return fallback
871
+
872
+ if len(candidates) == 1:
873
+ return nodes.Const(next(iter(candidates)))
874
+ return fallback
854
875
 
855
876
 
856
877
  def infer_int(node, context: InferenceContext | None = None):
@@ -957,7 +978,7 @@ def infer_dict_fromkeys(node, context: InferenceContext | None = None):
957
978
 
958
979
 
959
980
  def _infer_copy_method(
960
- node: nodes.Call, context: InferenceContext | None = None, **kwargs: Any
981
+ node: nodes.Call, context: InferenceContext | None = None
961
982
  ) -> Iterator[CopyResult]:
962
983
  assert isinstance(node.func, nodes.Attribute)
963
984
  inferred_orig, inferred_copy = itertools.tee(node.func.expr.infer(context=context))
@@ -986,7 +1007,7 @@ def _is_str_format_call(node: nodes.Call) -> bool:
986
1007
 
987
1008
 
988
1009
  def _infer_str_format_call(
989
- node: nodes.Call, context: InferenceContext | None = None, **kwargs: Any
1010
+ node: nodes.Call, context: InferenceContext | None = None
990
1011
  ) -> Iterator[ConstFactoryResult | util.UninferableBase]:
991
1012
  """Return a Const node based on the template and passed arguments."""
992
1013
  call = arguments.CallSite.from_call(node, context=context)
@@ -571,10 +571,27 @@ def _get_field_default(field_call: nodes.Call) -> _FieldDefaultReturn:
571
571
  def _is_keyword_only_sentinel(node: nodes.NodeNG) -> bool:
572
572
  """Return True if node is the KW_ONLY sentinel."""
573
573
  inferred = safe_infer(node)
574
- return (
575
- isinstance(inferred, bases.Instance)
576
- and inferred.qname() == "dataclasses._KW_ONLY_TYPE"
577
- )
574
+ if not isinstance(inferred, bases.Instance):
575
+ return False
576
+ if inferred.qname() == "dataclasses._KW_ONLY_TYPE":
577
+ return True
578
+ if inferred.qname() != "builtins.sentinel":
579
+ return False
580
+ if isinstance(node, nodes.Name):
581
+ _, assignments = node.lookup(node.name)
582
+ return any(
583
+ isinstance(assignment, nodes.ImportFrom)
584
+ and assignment.modname == "dataclasses"
585
+ and any(imported == "KW_ONLY" for imported, _ in assignment.names)
586
+ for assignment in assignments
587
+ )
588
+ if isinstance(node, nodes.Attribute) and node.attrname == "KW_ONLY":
589
+ inferred_expr = safe_infer(node.expr)
590
+ return (
591
+ isinstance(inferred_expr, nodes.Module)
592
+ and inferred_expr.qname() == "dataclasses"
593
+ )
594
+ return False
578
595
 
579
596
 
580
597
  def _is_init_var(node: nodes.NodeNG) -> bool:
@@ -114,6 +114,8 @@ def _functools_partial_inference(
114
114
  name=inferred_wrapped_function.name,
115
115
  lineno=inferred_wrapped_function.lineno,
116
116
  col_offset=inferred_wrapped_function.col_offset,
117
+ end_lineno=inferred_wrapped_function.end_lineno,
118
+ end_col_offset=inferred_wrapped_function.end_col_offset,
117
119
  parent=node.parent,
118
120
  )
119
121
  partial_function.postinit(
@@ -143,9 +143,11 @@ def _gi_build_stub(parent): # noqa: C901
143
143
 
144
144
  val = constants[name]
145
145
 
146
- strval = str(val)
147
- if isinstance(val, str):
148
- strval = '"%s"' % str(val).replace("\\", "\\\\")
146
+ if isinstance(val, str): # pragma: no cover
147
+ val_repr = val.replace("\\", "\\\\")
148
+ strval = f'"{val_repr}"'
149
+ else: # pragma: no cover
150
+ strval = str(val)
149
151
  ret += f"{name} = {strval}\n"
150
152
 
151
153
  if ret:
@@ -8,6 +8,7 @@ from astroid.builder import parse
8
8
  from astroid.exceptions import InferenceError
9
9
  from astroid.manager import AstroidManager
10
10
  from astroid.nodes.scoped_nodes import FunctionDef
11
+ from astroid.util import UninferableBase
11
12
 
12
13
 
13
14
  def _multiprocessing_transform():
@@ -30,6 +31,9 @@ def _multiprocessing_transform():
30
31
  except (InferenceError, StopIteration):
31
32
  return module
32
33
 
34
+ if isinstance(context, UninferableBase) or isinstance(base, UninferableBase):
35
+ return module
36
+
33
37
  for node in (context, base):
34
38
  for key, value in node.locals.items():
35
39
  if key.startswith("_"):
@@ -19,6 +19,7 @@ from astroid.exceptions import (
19
19
  AstroidTypeError,
20
20
  AstroidValueError,
21
21
  InferenceError,
22
+ MroError,
22
23
  UseInferenceDefault,
23
24
  )
24
25
  from astroid.inference_tip import inference_tip
@@ -137,6 +138,11 @@ def infer_func_form(
137
138
  attributes = [str(attr) for attr in attributes]
138
139
  # XXX this should succeed *unless* __str__/__repr__ is incorrect or throws
139
140
  # in which case we should not have inferred these values and raised earlier
141
+ if any(not isinstance(attr, str) for attr in attributes):
142
+ # Enum members must be named by strings; a non-string attribute (e.g.
143
+ # ``Enum("e", (1,))``) means the definition is invalid, so fall back to
144
+ # the default inference instead of crashing.
145
+ raise UseInferenceDefault
140
146
  attributes = [attr for attr in attributes if " " not in attr]
141
147
 
142
148
  # If we can't infer the name of the class, don't crash, up to this point
@@ -264,7 +270,7 @@ def _get_renamed_namedtuple_attributes(field_names):
264
270
  or name.startswith("_")
265
271
  or name in seen
266
272
  ):
267
- names[i] = "_%d" % i
273
+ names[i] = f"_{i}"
268
274
  seen.add(name)
269
275
  return tuple(names)
270
276
 
@@ -386,7 +392,13 @@ INT_FLAG_ADDITION_METHODS = """
386
392
 
387
393
  def infer_enum_class(node: nodes.ClassDef) -> nodes.ClassDef:
388
394
  """Specific inference for enums."""
389
- for basename in (b for cls in node.mro() for b in cls.basenames):
395
+ try:
396
+ mro = node.mro()
397
+ except MroError:
398
+ # A malformed class hierarchy (e.g. duplicate bases) has no resolvable
399
+ # MRO; leave the node untransformed rather than crashing.
400
+ return node
401
+ for basename in (b for cls in mro for b in cls.basenames):
390
402
  if node.root().name == "enum":
391
403
  # Skip if the class is directly from enum module.
392
404
  break
@@ -15,11 +15,11 @@ from astroid.manager import AstroidManager
15
15
 
16
16
 
17
17
  def numpy_core_umath_transform() -> nodes.Module:
18
- ufunc_optional_keyword_arguments = (
18
+ opt_args = (
19
19
  """out=None, where=True, casting='same_kind', order='K', """
20
20
  """dtype=None, subok=True"""
21
21
  )
22
- return parse("""
22
+ return parse(f"""
23
23
  class FakeUfunc:
24
24
  def __init__(self):
25
25
  self.__doc__ = str()
@@ -144,7 +144,7 @@ def numpy_core_umath_transform() -> nodes.Module:
144
144
  right_shift = FakeUfuncTwoArgs()
145
145
  subtract = FakeUfuncTwoArgs()
146
146
  true_divide = FakeUfuncTwoArgs()
147
- """.format(opt_args=ufunc_optional_keyword_arguments))
147
+ """)
148
148
 
149
149
 
150
150
  def register(manager: AstroidManager) -> None:
@@ -23,7 +23,7 @@ def _clone_node_with_lineno(node, parent, lineno):
23
23
  cls = node.__class__
24
24
  other_fields = node._other_fields
25
25
  _astroid_fields = node._astroid_fields
26
- init_params = {
26
+ candidate_init_params = {
27
27
  "lineno": lineno,
28
28
  "col_offset": node.col_offset,
29
29
  "parent": parent,
@@ -33,6 +33,11 @@ def _clone_node_with_lineno(node, parent, lineno):
33
33
  postinit_params = {param: getattr(node, param) for param in _astroid_fields}
34
34
 
35
35
  valid_init_params = set(inspect.signature(cls.__init__).parameters)
36
+ init_params = {
37
+ name: value
38
+ for name, value in candidate_init_params.items()
39
+ if name in valid_init_params
40
+ }
36
41
  for param in other_fields:
37
42
  if param in valid_init_params:
38
43
  init_params[param] = getattr(node, param)
@@ -7,7 +7,6 @@
7
7
  from __future__ import annotations
8
8
 
9
9
  import contextlib
10
- import pprint
11
10
  from collections.abc import Iterator, Sequence
12
11
  from typing import TYPE_CHECKING
13
12
 
@@ -154,6 +153,8 @@ class InferenceContext:
154
153
  )
155
154
 
156
155
  def __str__(self) -> str:
156
+ import pprint # pylint: disable=import-outside-toplevel
157
+
157
158
  state = (
158
159
  f"{field}={pprint.pformat(getattr(self, field), width=80 - len(field))}"
159
160
  for field in self.__slots__
@@ -30,9 +30,7 @@ def path_wrapper(func):
30
30
  """
31
31
 
32
32
  @functools.wraps(func)
33
- def wrapped(
34
- node, context: InferenceContext | None = None, _func=func, **kwargs
35
- ) -> Generator:
33
+ def wrapped(node, context: InferenceContext | None = None, _func=func) -> Generator:
36
34
  """Wrapper function handling context."""
37
35
  if context is None:
38
36
  context = InferenceContext()
@@ -41,7 +39,7 @@ def path_wrapper(func):
41
39
 
42
40
  yielded = set()
43
41
 
44
- for res in _func(node, context, **kwargs):
42
+ for res in _func(node, context):
45
43
  # unproxy only true instance, not const, tuple, dict...
46
44
  if res.__class__.__name__ == "Instance":
47
45
  ares = res._proxied
@@ -9,11 +9,10 @@ from __future__ import annotations
9
9
  from collections.abc import Iterable, Iterator
10
10
  from typing import TYPE_CHECKING, Any
11
11
 
12
- from astroid.typing import InferenceResult, SuccessfulInferenceResult
13
-
14
12
  if TYPE_CHECKING:
15
13
  from astroid import arguments, bases, nodes, objects
16
14
  from astroid.context import InferenceContext
15
+ from astroid.typing import InferenceResult, SuccessfulInferenceResult
17
16
 
18
17
  __all__ = (
19
18
  "AstroidBuildingError",
@@ -66,6 +66,10 @@ def _object_type(
66
66
  yield _build_proxy_class("module", builtins)
67
67
  elif isinstance(inferred, nodes.Unknown):
68
68
  raise InferenceError
69
+ elif isinstance(inferred, (nodes.TypeVar, nodes.TypeVarTuple, nodes.ParamSpec)):
70
+ # PEP 695 generic type parameters have no concrete type at
71
+ # static-analysis time, so the type cannot be determined.
72
+ yield util.Uninferable
69
73
  elif isinstance(inferred, util.UninferableBase):
70
74
  yield inferred
71
75
  elif isinstance(inferred, (bases.Proxy, nodes.Slice, objects.Super)):
@@ -113,13 +117,14 @@ def _object_type_is_subclass(
113
117
  # strict compatibility with issubclass
114
118
  # issubclass(type, (object, 1)) evaluates to true
115
119
  # issubclass(object, (1, type)) raises TypeError
120
+ obj_mro = obj_type.mro()
116
121
  for klass in class_seq:
117
122
  if isinstance(klass, util.UninferableBase):
118
123
  raise AstroidTypeError(
119
124
  "arg 2 must be a type or tuple of types, not <class 'astroid.util.UninferableBase'>"
120
125
  )
121
126
 
122
- for obj_subclass in obj_type.mro():
127
+ for obj_subclass in obj_mro:
123
128
  if obj_subclass == klass:
124
129
  return True
125
130
  return False
@@ -273,9 +278,7 @@ def object_len(node, context: InferenceContext | None = None):
273
278
  ):
274
279
  message = (
275
280
  "Self referential __len__ function will "
276
- "cause a RecursionError on line {} of {}".format(
277
- node.lineno, node.root().file
278
- )
281
+ f"cause a RecursionError on line {node.lineno} of {node.root().file}"
279
282
  )
280
283
  raise InferenceError(message)
281
284
 
@@ -39,7 +39,6 @@ def _inference_tip_cached(func: InferFn[_NodesT]) -> InferFn[_NodesT]:
39
39
  def inner(
40
40
  node: _NodesT,
41
41
  context: InferenceContext | None = None,
42
- **kwargs: Any,
43
42
  ) -> Generator[InferenceResult]:
44
43
  partial_cache_key = (func, node)
45
44
  if partial_cache_key in _CURRENTLY_INFERRING:
@@ -62,9 +61,7 @@ def _inference_tip_cached(func: InferFn[_NodesT]) -> InferFn[_NodesT]:
62
61
  _CURRENTLY_INFERRING.add(partial_cache_key)
63
62
  try:
64
63
  # May raise UseInferenceDefault
65
- result = _cache[func, node, context] = list(
66
- func(node, context, **kwargs)
67
- )
64
+ result = _cache[func, node, context] = list(func(node, context))
68
65
  except Exception as e:
69
66
  # Suppress the KeyError from the cache miss.
70
67
  raise e from None
@@ -117,12 +114,8 @@ def inference_tip(
117
114
  and node._explicit_inference is not infer_function
118
115
  ):
119
116
  raise InferenceOverwriteError(
120
- "Inference already set to {existing_inference}. "
121
- "Trying to overwrite with {new_inference} for {node}".format(
122
- existing_inference=infer_function,
123
- new_inference=node._explicit_inference,
124
- node=node,
125
- )
117
+ f"Inference already set to {infer_function}. "
118
+ f"Trying to overwrite with {node._explicit_inference} for {node}"
126
119
  )
127
120
  node._explicit_inference = _inference_tip_cached(infer_function)
128
121
  return node
@@ -72,10 +72,10 @@ def is_namespace(modname: str) -> bool:
72
72
  # Workaround for "py" module
73
73
  # https://github.com/pytest-dev/apipkg/issues/13
74
74
  return False
75
- except KeyError:
76
- # Intermediate steps might raise KeyErrors
77
- # https://github.com/python/cpython/issues/93334
78
- # TODO: update if fixed in importlib
75
+ # PY314: When dropping support for 3.14, replace with just
76
+ # except ModuleNotFoundError:
77
+ except (KeyError, ModuleNotFoundError):
78
+ # Intermediate steps might raise ModuleNotFoundError
79
79
  # For tree a > b > c.py
80
80
  # >>> from importlib.machinery import PathFinder
81
81
  # >>> PathFinder.find_spec('a.b', ['a'])
@@ -62,7 +62,9 @@ def _class_lookup(
62
62
  node: nodes.ClassDef, name: str, context: InferenceContext | None = None
63
63
  ) -> list:
64
64
  metaclass = node.metaclass(context=context)
65
- if metaclass is None:
65
+ # An explicit metaclass may infer to a non-class node (e.g. a function),
66
+ # which has no MRO to look the special method up in.
67
+ if not isinstance(metaclass, nodes.ClassDef):
66
68
  raise AttributeInferenceError(attribute=name, target=node)
67
69
 
68
70
  return _lookup_in_mro(metaclass, name)
@@ -25,7 +25,6 @@ from __future__ import annotations
25
25
 
26
26
  import itertools
27
27
  import os
28
- import pprint
29
28
  import types
30
29
  from collections.abc import Iterator
31
30
  from functools import lru_cache
@@ -82,6 +81,8 @@ class ObjectModel:
82
81
  self._instance = None
83
82
 
84
83
  def __repr__(self):
84
+ import pprint # pylint: disable=import-outside-toplevel
85
+
85
86
  result = []
86
87
  cname = type(self).__name__
87
88
  string = "%(cname)s(%(fields)s)"
@@ -459,14 +460,19 @@ class FunctionModel(ObjectModel):
459
460
 
460
461
  # Rebuild the original value, but with the parent set as the
461
462
  # class where it will be bound.
462
- new_func = func.__class__(
463
- name=func.name,
464
- lineno=func.lineno,
465
- col_offset=func.col_offset,
466
- parent=func.parent,
467
- end_lineno=func.end_lineno,
468
- end_col_offset=func.end_col_offset,
469
- )
463
+ new_func_kwargs = {
464
+ "name": func.name,
465
+ "lineno": func.lineno,
466
+ "col_offset": func.col_offset,
467
+ "parent": func.parent,
468
+ "end_lineno": func.end_lineno,
469
+ "end_col_offset": func.end_col_offset,
470
+ }
471
+ if isinstance(func, astroid.objects.PartialFunction):
472
+ new_func_kwargs["filled_args"] = func.filled_args
473
+ new_func_kwargs["filled_keywords"] = func.filled_keywords
474
+
475
+ new_func = func.__class__(**new_func_kwargs)
470
476
  # pylint: disable=no-member
471
477
  new_func.postinit(
472
478
  func.args,
@@ -21,7 +21,6 @@ import importlib.machinery
21
21
  import importlib.util
22
22
  import io
23
23
  import itertools
24
- import logging
25
24
  import os
26
25
  import sys
27
26
  import sysconfig
@@ -34,9 +33,6 @@ from sys import stdlib_module_names
34
33
  from astroid.const import IS_JYTHON
35
34
  from astroid.interpreter._import import spec, util
36
35
 
37
- logger = logging.getLogger(__name__)
38
-
39
-
40
36
  if sys.platform.startswith("win"):
41
37
  PY_SOURCE_EXTS = ("py", "pyw", "pyi")
42
38
  PY_SOURCE_EXTS_STUBS_FIRST = ("pyi", "pyw", "py")
@@ -79,7 +75,7 @@ if os.name == "posix":
79
75
  prefix = sys.prefix
80
76
 
81
77
  def _posix_path(path: str) -> str:
82
- base_python = "python%d.%d" % sys.version_info[:2]
78
+ base_python = f"python{sys.version_info.major}.{sys.version_info.minor}"
83
79
  return os.path.join(prefix, path, base_python)
84
80
 
85
81
  STD_LIB_DIRS.add(_posix_path("lib"))
@@ -177,15 +173,19 @@ def load_module_from_name(dotted_name: str) -> types.ModuleType:
177
173
  module = importlib.import_module(dotted_name)
178
174
 
179
175
  stderr_value = stderr.getvalue()
180
- if stderr_value:
181
- logger.error(
182
- "Captured stderr while importing %s:\n%s", dotted_name, stderr_value
183
- )
184
176
  stdout_value = stdout.getvalue()
185
- if stdout_value:
186
- logger.info(
187
- "Captured stdout while importing %s:\n%s", dotted_name, stdout_value
188
- )
177
+ if stderr_value or stdout_value:
178
+ import logging # pylint: disable=import-outside-toplevel
179
+
180
+ logger = logging.getLogger(__name__)
181
+ if stderr_value:
182
+ logger.error(
183
+ "Captured stderr while importing %s:\n%s", dotted_name, stderr_value
184
+ )
185
+ if stdout_value:
186
+ logger.info(
187
+ "Captured stdout while importing %s:\n%s", dotted_name, stdout_value
188
+ )
189
189
 
190
190
  return module
191
191
 
@@ -143,7 +143,10 @@ class ImportNode(FilterStmtsBaseNode, NoChildrenNode, Statement):
143
143
  """
144
144
 
145
145
  def _infer_name(self, frame, name):
146
- return name
146
+ try:
147
+ return self.real_name(name)
148
+ except AttributeInferenceError:
149
+ return None
147
150
 
148
151
  def do_import_module(self, modname: str | None = None) -> nodes.Module:
149
152
  """Return the ast for a module whose name is <modname> imported by <self>."""