aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2021-11-06 15:22:51 +0100
committerGitHub <noreply@github.com>2021-11-06 15:22:51 +0100
commit62f3cfb18eb5e7d27f69f32c7412972d8bfff5fe (patch)
treef2d12f52ef7308eb2d9d2e0889df165ee6e58747
parentcdf8a2a9813128db5732a792434b89967c6fb701 (diff)
downloadastroid-62f3cfb18eb5e7d27f69f32c7412972d8bfff5fe.tar.gz
Small changes (#1232)
* Based on suggestions from #1218
-rw-r--r--ChangeLog1
-rw-r--r--astroid/decorators.py2
-rw-r--r--astroid/nodes/node_classes.py3
-rw-r--r--tests/unittest_inference.py6
4 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d4d51f39..baf3638f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@ What's New in astroid 2.8.5?
============================
Release date: TBA
+* Added missing ``kind`` (for ``Const``) and ``conversion`` (for ``FormattedValue``) fields to repr.
What's New in astroid 2.8.4?
diff --git a/astroid/decorators.py b/astroid/decorators.py
index 66d9cb09..734cbd45 100644
--- a/astroid/decorators.py
+++ b/astroid/decorators.py
@@ -197,7 +197,7 @@ def deprecate_default_argument_values(
)
):
warnings.warn(
- f"'{arg}' will be a required attribute for "
+ f"'{arg}' will be a required argument for "
f"'{args[0].__class__.__qualname__}.{func.__name__}' in astroid {astroid_version} "
f"('{arg}' should be of type: '{type_annotation}')",
DeprecationWarning,
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py
index d94bda39..b8b7c575 100644
--- a/astroid/nodes/node_classes.py
+++ b/astroid/nodes/node_classes.py
@@ -1846,7 +1846,7 @@ class Const(mixins.NoChildrenMixin, NodeNG, Instance):
<Const.bytes l.1 at 0x7f23b2e35a20>]
"""
- _other_fields = ("value",)
+ _other_fields = ("value", "kind")
def __init__(
self,
@@ -4076,6 +4076,7 @@ class FormattedValue(NodeNG):
"""
_astroid_fields = ("value", "format_spec")
+ _other_fields = ("conversion",)
def __init__(
self,
diff --git a/tests/unittest_inference.py b/tests/unittest_inference.py
index c619c0b0..128b24e4 100644
--- a/tests/unittest_inference.py
+++ b/tests/unittest_inference.py
@@ -1191,7 +1191,11 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase):
# (__name__ == '__main__') and through pytest (__name__ ==
# 'unittest_inference')
self.assertEqual(
- value, [f"Instance of {__name__}.myarray", "Const.int(value=5)"]
+ value,
+ [
+ f"Instance of {__name__}.myarray",
+ "Const.int(value=5,\n kind=None)",
+ ],
)
def test_nonregr_lambda_arg(self) -> None: