astroid 4.3.0__tar.gz → 4.3.2__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.
- {astroid-4.3.0 → astroid-4.3.2}/CONTRIBUTORS.txt +2 -1
- {astroid-4.3.0/astroid.egg-info → astroid-4.3.2}/PKG-INFO +1 -1
- {astroid-4.3.0 → astroid-4.3.2}/astroid/__pkginfo__.py +1 -1
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_builtin_inference.py +2 -1
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_namedtuple_enum.py +12 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_six.py +6 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_typing.py +6 -1
- {astroid-4.3.0 → astroid-4.3.2}/astroid/exceptions.py +7 -3
- {astroid-4.3.0 → astroid-4.3.2}/astroid/interpreter/objectmodel.py +6 -2
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/node_classes.py +2 -1
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/scoped_nodes/scoped_nodes.py +13 -2
- {astroid-4.3.0 → astroid-4.3.2/astroid.egg-info}/PKG-INFO +1 -1
- {astroid-4.3.0 → astroid-4.3.2}/requirements_minimal.txt +1 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_builtin.py +2 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_named_tuple.py +59 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_six.py +20 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_typing.py +16 -3
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_inference.py +9 -1
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_object_model.py +20 -4
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_scoped_nodes.py +9 -0
- {astroid-4.3.0 → astroid-4.3.2}/LICENSE +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/MANIFEST.in +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/README.rst +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/__main__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/_ast.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/arguments.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/astroid_manager.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/bases.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_argparse.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_attrs.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_boto3.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_collections.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_crypt.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_ctypes.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_curses.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_dataclasses.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_datetime.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_dateutil.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_decimal.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_functools.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_gi.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_hashlib.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_http.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_hypothesis.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_io.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_mechanize.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_multiprocessing.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_core_einsumfunc.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_core_fromnumeric.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_core_function_base.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_core_multiarray.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_core_numeric.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_core_numerictypes.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_core_umath.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_ma.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_ndarray.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_random_mtrand.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_numpy_utils.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_pathlib.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_pkg_resources.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_pytest.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_qt.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_random.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_re.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_regex.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_responses.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_scipy_signal.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_signal.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_sqlalchemy.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_ssl.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_statistics.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_subprocess.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_threading.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_type.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_unittest.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/brain_uuid.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/brain/helpers.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/builder.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/const.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/constraint.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/context.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/decorators.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/filter_statements.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/helpers.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/inference_tip.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/interpreter/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/interpreter/_import/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/interpreter/_import/spec.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/interpreter/_import/util.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/interpreter/dunder_lookup.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/manager.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/modutils.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/_base_nodes.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/as_string.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/const.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/node_ng.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/scoped_nodes/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/scoped_nodes/mixin.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/scoped_nodes/utils.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/nodes/utils.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/objects.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/protocols.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/raw_building.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/rebuilder.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/test_utils.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/transforms.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/typing.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid/util.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid.egg-info/SOURCES.txt +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid.egg-info/dependency_links.txt +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid.egg-info/requires.txt +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/astroid.egg-info/top_level.txt +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/pyproject.toml +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/requirements_dev.txt +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/requirements_full.txt +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/setup.cfg +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/benchmarks/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/benchmarks/conftest.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/benchmarks/test_bench_endtoend.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_core_einsumfunc.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_core_fromnumeric.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_core_function_base.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_core_multiarray.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_core_numeric.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_core_numerictypes.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_core_umath.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_ma.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_ndarray.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/numpy/test_random_mtrand.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_argparse.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_attr.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_brain.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_ctypes.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_dataclasses.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_dateutil.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_enum.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_gi.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_hashlib.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_helpers.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_multiprocessing.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_pathlib.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_pytest.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_qt.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_regex.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_signal.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_ssl.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_statistics.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_threading.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_typing_extensions.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/brain/test_unittest.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/resources.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_builder.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_constraint.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_context.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_decorators.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_filter_statements.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_get_relative_base_path.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_group_exceptions.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_helpers.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_inference_calls.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_lookup.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_manager.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_modutils.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_nodes.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_nodes_lineno.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_nodes_position.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_objects.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_protocols.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_python3.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_raw_building.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_regrtest.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_stdlib.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_transforms.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_type_params.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/test_utils.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/MyPyPa-0.1.0-py2.5.egg +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/MyPyPa-0.1.0-py2.5.zip +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/SSL1/Connection1.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/SSL1/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/absimp/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/absimp/sidepackage/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/absimp/string.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/absimport.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/all.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/appl/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/appl/myConnection.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level/import_package.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level/namespace_package/lower_level/helper_function.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level/namespace_package/plugin_api.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level/namespace_package/top_level_function.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_three/double_name/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_three/module/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_three/module/double_name/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_three/module/double_name/function.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_three/module/sub_module/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_three/module/sub_module/sub_sub_module/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_three/module/sub_module/sub_sub_module/main.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_two/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_two/a.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_two/level1/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/beyond_top_level_two/level1/beyond_top_level_two.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/cache/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/cache/a.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/conditional.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/conditional_import/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/contribute_to_namespace/namespace_pep_420/submodule.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/descriptor_crash.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/divide_by_zero.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/email.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/fake_module_with_broken_getattr.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/fake_module_with_collection_getattribute.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/fake_module_with_warnings.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/find_test/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/find_test/module.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/find_test/module2.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/find_test/noendingnewline.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/find_test/nonregr.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/foogle/fax/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/foogle/fax/a.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/foogle_fax-0.12.5-py2.7-nspkg.pth +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/format.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/import_conflicting_names/math.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/import_setuptools_pep660/__editable___example_0_1_0_finder.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/import_setuptools_pep660/example/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/import_setuptools_pep660/example/subpackage/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/invalid_encoding.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/lmfp/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/lmfp/foo.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/max_inferable_limit_for_classes/main.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/max_inferable_limit_for_classes/nodes/roles.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/max_inferable_limit_for_classes/other_funcs.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/metaclass_recursion/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/metaclass_recursion/monkeypatch.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/metaclass_recursion/parent.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/module.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/module1abs/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/module1abs/core.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/module2.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/module3.14.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/module_dict_items_call/models.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/module_dict_items_call/test.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/namespace_pep_420/module.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/noendingnewline.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/nonregr.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/notall.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/notamodule/file.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/operator_precedence.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/package/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/package/absimport.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/package/hello.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/package/import_package_subpackage_module.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/package/subpackage/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/package/subpackage/module.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/parent_of_homonym/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/parent_of_homonym/doc/README.md +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/parent_of_homonym/doc/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkg_resources_1/package/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkg_resources_1/package/foo.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkg_resources_2/package/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkg_resources_2/package/bar.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkg_resources_3/package/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkg_resources_3/package/baz.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkgutil_1/package/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkgutil_1/package/foo.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkgutil_2/package/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkgutil_2/package/bar.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkgutil_3/package/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/path_pkgutil_3/package/baz.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/recursion.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/tmp__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/unicode_package/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/unicode_package/core/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/data/x.zip +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/__init__.pyi +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/find_test/__init__.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/find_test/__init__.pyi +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/find_test/__init__.weird_ext +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/find_test/module.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/find_test/module2.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/find_test/noendingnewline.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/find_test/nonregr.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/find_test/standalone_file.weird_ext +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/pyi_data/module.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tests/testdata/python3/recursion_error.py +0 -0
- {astroid-4.3.0 → astroid-4.3.2}/tox.ini +0 -0
|
@@ -50,9 +50,9 @@ Contributors
|
|
|
50
50
|
- Antonio <antonio@zoftko.com>
|
|
51
51
|
- Fridayworks <aifriday700@gmail.com>
|
|
52
52
|
- Akhil Kamat <akhil.kamat@gmail.com>
|
|
53
|
+
- KALI 834X <kali834x@gmail.com>
|
|
53
54
|
- Tim Martin <tim@asymptotic.co.uk>
|
|
54
55
|
- Phil Schaf <flying-sheep@web.de>
|
|
55
|
-
- KALI 834X <kali834x@gmail.com>
|
|
56
56
|
- Alex Hall <alex.mojaki@gmail.com>
|
|
57
57
|
- Vincent Gao <gaobing1230@gmail.com>
|
|
58
58
|
- Samarth D N <dnsam550@gmail.com>
|
|
@@ -245,6 +245,7 @@ Contributors
|
|
|
245
245
|
- Alexander Scheel <alexander.m.scheel@gmail.com>
|
|
246
246
|
- Alexander Presnyakov <flagist0@gmail.com>
|
|
247
247
|
- Ahmed Azzaoui <ahmed.azzaoui@engie.com>
|
|
248
|
+
- Florian Meyer <fflorian.meyer@outlook.com>
|
|
248
249
|
|
|
249
250
|
Co-Author
|
|
250
251
|
---------
|
|
@@ -1142,11 +1142,12 @@ def _infer_str_format_call(
|
|
|
1142
1142
|
formatted_string = formatter.format(
|
|
1143
1143
|
format_template, *pos_values, **keyword_values
|
|
1144
1144
|
)
|
|
1145
|
-
except (AttributeError, IndexError, KeyError, TypeError, ValueError):
|
|
1145
|
+
except (AttributeError, IndexError, KeyError, TypeError, ValueError, OverflowError):
|
|
1146
1146
|
# AttributeError: named field in format string was not found in the arguments
|
|
1147
1147
|
# IndexError: there are too few arguments to interpolate
|
|
1148
1148
|
# TypeError: Unsupported format string
|
|
1149
1149
|
# ValueError: Unknown format code
|
|
1150
|
+
# OverflowError: "c" with an out-of-range code point, e.g. "{:c}".format(-1)
|
|
1150
1151
|
return iter([util.Uninferable])
|
|
1151
1152
|
|
|
1152
1153
|
return iter([nodes.const_factory(formatted_string)])
|
|
@@ -229,6 +229,18 @@ def infer_named_tuple(
|
|
|
229
229
|
except AstroidValueError as exc:
|
|
230
230
|
raise UseInferenceDefault("ValueError: " + str(exc)) from exc
|
|
231
231
|
|
|
232
|
+
if tuple(class_node.instance_attrs) != tuple(attributes):
|
|
233
|
+
# ``infer_func_form`` recorded the field names as written, but ``rename=True``
|
|
234
|
+
# replaces invalid, keyword or duplicate names with ``_N``, so the instance
|
|
235
|
+
# would otherwise carry names the namedtuple does not actually have (and lose
|
|
236
|
+
# the duplicated ones entirely). Rebuild them from the renamed fields.
|
|
237
|
+
class_node.instance_attrs.clear()
|
|
238
|
+
for attr in attributes:
|
|
239
|
+
fake_node = nodes.EmptyNode()
|
|
240
|
+
fake_node.parent = class_node
|
|
241
|
+
fake_node.attrname = attr
|
|
242
|
+
class_node.instance_attrs[attr] = [fake_node]
|
|
243
|
+
|
|
232
244
|
replace_args = ", ".join(f"{arg}=None" for arg in attributes)
|
|
233
245
|
field_def = (
|
|
234
246
|
" {name} = property(lambda self: self[{index:d}], "
|
|
@@ -220,6 +220,12 @@ def transform_six_with_metaclass(node):
|
|
|
220
220
|
If so, inject its argument as the metaclass of the underlying class.
|
|
221
221
|
"""
|
|
222
222
|
call = node.bases[0]
|
|
223
|
+
if not call.args:
|
|
224
|
+
# ``six.with_metaclass()`` written with no positional metaclass
|
|
225
|
+
# argument is invalid, but the predicate still matches it.
|
|
226
|
+
raise InferenceError(
|
|
227
|
+
"six.with_metaclass() call has no metaclass argument", node=node
|
|
228
|
+
)
|
|
223
229
|
node._metaclass = call.args[0]
|
|
224
230
|
return node
|
|
225
231
|
|
|
@@ -126,9 +126,14 @@ def infer_typing_typevar_or_newtype(
|
|
|
126
126
|
|
|
127
127
|
typename = node.args[0].as_string().strip("'")
|
|
128
128
|
try:
|
|
129
|
-
|
|
129
|
+
# ``typing`` accepts any string as a name, so don't splice it into the
|
|
130
|
+
# template: a crafted value such as ``"T(Base): #"`` would break out of
|
|
131
|
+
# the identifier position and inject bases and a body into the class.
|
|
132
|
+
# Build the class with a fixed name and assign the real one afterwards.
|
|
133
|
+
node = extract_node(TYPING_TYPE_TEMPLATE.format("_TypeVar"))
|
|
130
134
|
except AstroidSyntaxError as exc:
|
|
131
135
|
raise InferenceError from exc
|
|
136
|
+
node.name = typename
|
|
132
137
|
return node.infer(context=context_itton)
|
|
133
138
|
|
|
134
139
|
|
|
@@ -63,10 +63,14 @@ class AstroidError(Exception):
|
|
|
63
63
|
setattr(self, key, value)
|
|
64
64
|
|
|
65
65
|
def __str__(self) -> str:
|
|
66
|
+
# message is the template itself and may embed interpolated user text
|
|
67
|
+
# (e.g. a namedtuple typename), so keep it out of the fields and fall
|
|
68
|
+
# back to it verbatim rather than raising or reinterpreting it.
|
|
69
|
+
fields = {k: v for k, v in vars(self).items() if k != "message"}
|
|
66
70
|
try:
|
|
67
|
-
return self.message.format(**
|
|
68
|
-
except ValueError:
|
|
69
|
-
return self.message
|
|
71
|
+
return self.message.format(**fields)
|
|
72
|
+
except (LookupError, ValueError, AttributeError, TypeError):
|
|
73
|
+
return self.message
|
|
70
74
|
|
|
71
75
|
|
|
72
76
|
class AstroidBuildingError(AstroidError):
|
|
@@ -817,8 +817,12 @@ class InstanceModel(ObjectModel):
|
|
|
817
817
|
|
|
818
818
|
class ExceptionInstanceModel(InstanceModel):
|
|
819
819
|
@property
|
|
820
|
-
def attr_args(self) ->
|
|
821
|
-
|
|
820
|
+
def attr_args(self) -> bases.Instance:
|
|
821
|
+
# The arguments an exception was created with are not known from the
|
|
822
|
+
# instance alone, so ``args`` is a tuple of unknown contents rather
|
|
823
|
+
# than a known empty tuple.
|
|
824
|
+
builtins_ast_module = AstroidManager().builtins_module
|
|
825
|
+
return builtins_ast_module["tuple"].instantiate_class()
|
|
822
826
|
|
|
823
827
|
@property
|
|
824
828
|
def attr___traceback__(self):
|
|
@@ -4770,9 +4770,10 @@ class FormattedValue(NodeNG):
|
|
|
4770
4770
|
end_col_offset=self.end_col_offset,
|
|
4771
4771
|
)
|
|
4772
4772
|
continue
|
|
4773
|
-
except (ValueError, TypeError, MemoryError):
|
|
4773
|
+
except (ValueError, TypeError, MemoryError, OverflowError):
|
|
4774
4774
|
# ValueError/TypeError: invalid format spec
|
|
4775
4775
|
# MemoryError: format spec with huge width (e.g. f'{0:11111111111}')
|
|
4776
|
+
# OverflowError: "c" with an out-of-range code point (e.g. f'{-1:c}')
|
|
4776
4777
|
yield util.Uninferable
|
|
4777
4778
|
uninferable_already_generated = True
|
|
4778
4779
|
continue
|
|
@@ -1578,13 +1578,22 @@ class FunctionDef(
|
|
|
1578
1578
|
):
|
|
1579
1579
|
if isinstance(caller.args, node_classes.Arguments):
|
|
1580
1580
|
assert caller.args.args is not None
|
|
1581
|
-
|
|
1581
|
+
call_args = caller.args.args
|
|
1582
1582
|
elif isinstance(caller.args, list):
|
|
1583
|
-
|
|
1583
|
+
call_args = caller.args
|
|
1584
1584
|
else:
|
|
1585
1585
|
raise TypeError( # pragma: no cover
|
|
1586
1586
|
f"caller.args was neither Arguments nor list; got {type(caller.args)}"
|
|
1587
1587
|
)
|
|
1588
|
+
if not call_args:
|
|
1589
|
+
# ``with_metaclass()`` called without a metaclass argument is
|
|
1590
|
+
# invalid; there is nothing to infer.
|
|
1591
|
+
raise InferenceError(
|
|
1592
|
+
"with_metaclass() call has no metaclass argument",
|
|
1593
|
+
node=self,
|
|
1594
|
+
context=context,
|
|
1595
|
+
)
|
|
1596
|
+
metaclass = next(call_args[0].infer(context), None)
|
|
1588
1597
|
if isinstance(metaclass, ClassDef):
|
|
1589
1598
|
class_bases = [_infer_last(x, context) for x in caller.args[1:]]
|
|
1590
1599
|
new_class = ClassDef(
|
|
@@ -2719,6 +2728,8 @@ class ClassDef(
|
|
|
2719
2728
|
return None
|
|
2720
2729
|
for slots in slots_attributes:
|
|
2721
2730
|
# check if __slots__ is a valid type
|
|
2731
|
+
if not hasattr(slots, "getattr"):
|
|
2732
|
+
continue
|
|
2722
2733
|
for meth in ITER_METHODS:
|
|
2723
2734
|
try:
|
|
2724
2735
|
slots.getattr(meth)
|
|
@@ -125,6 +125,8 @@ class TestStringNodes:
|
|
|
125
125
|
pytest.param(
|
|
126
126
|
""""{:>{}}".format("x", 2000000000)""", id="oversized-nested-width"
|
|
127
127
|
),
|
|
128
|
+
pytest.param(""""{:c}".format(-1)""", id="char-negative"),
|
|
129
|
+
pytest.param(""""{:c}".format(0x110000)""", id="char-too-large"),
|
|
128
130
|
],
|
|
129
131
|
)
|
|
130
132
|
def test_string_format_uninferable(self, format_string: str) -> None:
|
|
@@ -115,6 +115,32 @@ class NamedTupleTest(unittest.TestCase):
|
|
|
115
115
|
self.assertIn("_1", inferred.locals)
|
|
116
116
|
self.assertIn("_2", inferred.locals)
|
|
117
117
|
|
|
118
|
+
def test_namedtuple_rename_keywords_instance_attrs(self) -> None:
|
|
119
|
+
"""The instance carries the renamed field, not the name as written.
|
|
120
|
+
|
|
121
|
+
https://github.com/pylint-dev/astroid/issues/242
|
|
122
|
+
"""
|
|
123
|
+
node = builder.extract_node("""
|
|
124
|
+
from collections import namedtuple
|
|
125
|
+
Tuple = namedtuple("Tuple", "abc def", rename=True)
|
|
126
|
+
Tuple(1, 2) #@
|
|
127
|
+
""")
|
|
128
|
+
inferred = next(node.infer())
|
|
129
|
+
self.assertEqual(sorted(inferred.instance_attrs), ["_1", "abc"])
|
|
130
|
+
|
|
131
|
+
def test_namedtuple_rename_duplicates_instance_attrs(self) -> None:
|
|
132
|
+
"""Duplicate fields are renamed rather than collapsed on the instance.
|
|
133
|
+
|
|
134
|
+
https://github.com/pylint-dev/astroid/issues/242
|
|
135
|
+
"""
|
|
136
|
+
node = builder.extract_node("""
|
|
137
|
+
from collections import namedtuple
|
|
138
|
+
Tuple = namedtuple("Tuple", "abc abc abc", rename=True)
|
|
139
|
+
Tuple(1, 2, 3) #@
|
|
140
|
+
""")
|
|
141
|
+
inferred = next(node.infer())
|
|
142
|
+
self.assertEqual(sorted(inferred.instance_attrs), ["_1", "_2", "abc"])
|
|
143
|
+
|
|
118
144
|
def test_namedtuple_rename_uninferable(self) -> None:
|
|
119
145
|
node = builder.extract_node("""
|
|
120
146
|
from collections import namedtuple
|
|
@@ -218,6 +244,39 @@ class NamedTupleTest(unittest.TestCase):
|
|
|
218
244
|
inferred = next(node.infer())
|
|
219
245
|
self.assertIs(util.Uninferable, inferred) # would raise ValueError
|
|
220
246
|
|
|
247
|
+
def test_format_placeholder_typename_does_not_crash_inference(self) -> None:
|
|
248
|
+
"""A typename containing str.format placeholders must not be formatted.
|
|
249
|
+
|
|
250
|
+
Reported in https://github.com/pylint-dev/astroid/issues/3199.
|
|
251
|
+
"""
|
|
252
|
+
node = builder.extract_node("""
|
|
253
|
+
from collections import namedtuple
|
|
254
|
+
Tuple = namedtuple("{0}", "")
|
|
255
|
+
Tuple #@
|
|
256
|
+
""")
|
|
257
|
+
inferred = next(node.infer())
|
|
258
|
+
self.assertIs(util.Uninferable, inferred) # would raise IndexError
|
|
259
|
+
|
|
260
|
+
def test_missing_format_placeholder_typename_does_not_crash_inference(self) -> None:
|
|
261
|
+
node = builder.extract_node("""
|
|
262
|
+
from collections import namedtuple
|
|
263
|
+
Tuple = namedtuple("{missing}", "")
|
|
264
|
+
Tuple #@
|
|
265
|
+
""")
|
|
266
|
+
inferred = next(node.infer())
|
|
267
|
+
self.assertIs(util.Uninferable, inferred) # would raise KeyError
|
|
268
|
+
|
|
269
|
+
def test_attribute_format_placeholder_typename_does_not_crash_inference(
|
|
270
|
+
self,
|
|
271
|
+
) -> None:
|
|
272
|
+
node = builder.extract_node("""
|
|
273
|
+
from collections import namedtuple
|
|
274
|
+
Tuple = namedtuple("{message.foo}", "")
|
|
275
|
+
Tuple #@
|
|
276
|
+
""")
|
|
277
|
+
inferred = next(node.infer())
|
|
278
|
+
self.assertIs(util.Uninferable, inferred) # would raise AttributeError
|
|
279
|
+
|
|
221
280
|
def test_keyword_typename_does_not_crash_inference(self) -> None:
|
|
222
281
|
node = builder.extract_node("""
|
|
223
282
|
from collections import namedtuple
|
|
@@ -138,6 +138,26 @@ class SixBrainTest(unittest.TestCase):
|
|
|
138
138
|
klass = astroid.extract_node(code)
|
|
139
139
|
assert next(klass.ancestors()).name == "Enum"
|
|
140
140
|
|
|
141
|
+
def test_with_metaclass_no_arguments(self) -> None:
|
|
142
|
+
# ``six.with_metaclass()`` with no positional metaclass argument is
|
|
143
|
+
# invalid; the transform raises InferenceError instead of IndexError.
|
|
144
|
+
for call in ("six.with_metaclass()", "six.with_metaclass(a=1)"):
|
|
145
|
+
with self.assertRaises(astroid.InferenceError):
|
|
146
|
+
builder.parse(f"""
|
|
147
|
+
import six
|
|
148
|
+
class A({call}):
|
|
149
|
+
pass
|
|
150
|
+
""")
|
|
151
|
+
# With more than one base the class transform does not apply and the
|
|
152
|
+
# call itself is inferred; that raises too instead of yielding a
|
|
153
|
+
# bogus ``temporary_class`` ancestor.
|
|
154
|
+
klass = builder.extract_node("""
|
|
155
|
+
import six
|
|
156
|
+
class B(six.with_metaclass(), object): #@
|
|
157
|
+
pass
|
|
158
|
+
""")
|
|
159
|
+
self.assertEqual([a.name for a in klass.ancestors()], ["object"])
|
|
160
|
+
|
|
141
161
|
def test_six_with_metaclass_with_additional_transform(self) -> None:
|
|
142
162
|
def transform_class(cls: Any) -> ClassDef:
|
|
143
163
|
if cls.name == "A":
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import pytest
|
|
6
6
|
|
|
7
7
|
from astroid import bases, builder, nodes
|
|
8
|
-
from astroid.exceptions import InferenceError
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
def test_infer_typevar() -> None:
|
|
@@ -19,8 +18,22 @@ def test_infer_typevar() -> None:
|
|
|
19
18
|
from typing import TypeVar
|
|
20
19
|
TypeVar('My.Type')
|
|
21
20
|
""")
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
inferred = next(call_node.infer())
|
|
22
|
+
assert isinstance(inferred, nodes.ClassDef)
|
|
23
|
+
assert inferred.name == "My.Type"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def test_infer_typevar_name_injection() -> None:
|
|
27
|
+
"""A crafted TypeVar name must not be spliced into the synthesized class."""
|
|
28
|
+
call_node = builder.extract_node("""
|
|
29
|
+
from typing import TypeVar
|
|
30
|
+
TypeVar('T(EvilBase): #')
|
|
31
|
+
""")
|
|
32
|
+
inferred = next(call_node.infer())
|
|
33
|
+
assert isinstance(inferred, nodes.ClassDef)
|
|
34
|
+
# The name is kept verbatim instead of parsed, so no base is injected.
|
|
35
|
+
assert inferred.name == "T(EvilBase): #"
|
|
36
|
+
assert inferred.bases == []
|
|
24
37
|
|
|
25
38
|
|
|
26
39
|
class TestTypingAlias:
|
|
@@ -5392,6 +5392,13 @@ def test_fstring_oversized_width_uninferable(code: str) -> None:
|
|
|
5392
5392
|
assert list(node.infer()) == [util.Uninferable]
|
|
5393
5393
|
|
|
5394
5394
|
|
|
5395
|
+
@pytest.mark.parametrize("code", ["f'{-1:c}'", "f'{0x110000:c}'", "f'{2**64:c}'"])
|
|
5396
|
+
def test_fstring_char_out_of_range_uninferable(code: str) -> None:
|
|
5397
|
+
"""Regression test for https://github.com/pylint-dev/astroid/issues/3301."""
|
|
5398
|
+
node = extract_node(code)
|
|
5399
|
+
assert list(node.infer()) == [util.Uninferable]
|
|
5400
|
+
|
|
5401
|
+
|
|
5395
5402
|
def test_augassign_recursion() -> None:
|
|
5396
5403
|
"""Make sure inference doesn't throw a RecursionError.
|
|
5397
5404
|
|
|
@@ -6193,7 +6200,8 @@ def test_subclass_of_exception(code) -> None:
|
|
|
6193
6200
|
inferred = next(extract_node(code).infer())
|
|
6194
6201
|
assert isinstance(inferred, Instance)
|
|
6195
6202
|
args = next(inferred.igetattr("args"))
|
|
6196
|
-
assert isinstance(args,
|
|
6203
|
+
assert isinstance(args, Instance)
|
|
6204
|
+
assert args.qname() == "builtins.tuple"
|
|
6197
6205
|
|
|
6198
6206
|
|
|
6199
6207
|
def test_ifexp_inference() -> None:
|
|
@@ -698,7 +698,8 @@ class ExceptionModelTest(unittest.TestCase):
|
|
|
698
698
|
""")
|
|
699
699
|
assert isinstance(ast_nodes, list)
|
|
700
700
|
args = next(ast_nodes[0].infer())
|
|
701
|
-
assert isinstance(args,
|
|
701
|
+
assert isinstance(args, astroid.Instance)
|
|
702
|
+
assert args.qname() == "builtins.tuple"
|
|
702
703
|
tb = next(ast_nodes[1].infer())
|
|
703
704
|
# Python 3.11: If 'contextlib' is loaded, '__traceback__'
|
|
704
705
|
# could be set inside '__exit__' method in
|
|
@@ -836,9 +837,24 @@ class TestExceptionInstanceModel:
|
|
|
836
837
|
ast_node = builder.extract_node("""
|
|
837
838
|
BaseException() #@
|
|
838
839
|
""")
|
|
839
|
-
args
|
|
840
|
-
# BaseException doesn't have any required args, not even a string
|
|
841
|
-
|
|
840
|
+
args = next(ast_node.infer()).getattr("args")[0]
|
|
841
|
+
# BaseException doesn't have any required args, not even a string:
|
|
842
|
+
# ``args`` is a tuple whose contents are not known.
|
|
843
|
+
assert isinstance(args, astroid.Instance)
|
|
844
|
+
assert args.qname() == "builtins.tuple"
|
|
845
|
+
|
|
846
|
+
def test_args_unpacking_has_unknown_length(self) -> None:
|
|
847
|
+
"""``args`` is not a known empty tuple: unpacking it cannot be checked."""
|
|
848
|
+
ast_node = builder.extract_node("""
|
|
849
|
+
try:
|
|
850
|
+
pass
|
|
851
|
+
except ValueError as err:
|
|
852
|
+
err.args #@
|
|
853
|
+
""")
|
|
854
|
+
args = next(ast_node.infer())
|
|
855
|
+
assert isinstance(args, astroid.Instance)
|
|
856
|
+
assert args.qname() == "builtins.tuple"
|
|
857
|
+
assert not isinstance(args, nodes.Tuple)
|
|
842
858
|
|
|
843
859
|
|
|
844
860
|
@pytest.mark.parametrize("parentheses", (True, False))
|
|
@@ -1585,6 +1585,15 @@ class ClassNodeTest(ModuleLoader, unittest.TestCase):
|
|
|
1585
1585
|
# must return None instead of raising ``InferenceError``.
|
|
1586
1586
|
self.assertIsNone(module["Klass"].slots())
|
|
1587
1587
|
|
|
1588
|
+
@pytest.mark.skipif(not PY312_PLUS, reason="PEP 695 syntax requires Python 3.12")
|
|
1589
|
+
def test_slots_pep695_type_param_named_slots(self) -> None:
|
|
1590
|
+
module = builder.parse("""
|
|
1591
|
+
class C[__slots__]:
|
|
1592
|
+
def __init__(self):
|
|
1593
|
+
self.a = 1
|
|
1594
|
+
""")
|
|
1595
|
+
self.assertIsNone(module["C"].slots())
|
|
1596
|
+
|
|
1588
1597
|
def test_slots_added_dynamically_still_inferred(self) -> None:
|
|
1589
1598
|
code = """
|
|
1590
1599
|
class NodeBase(object):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|