File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
tests/functional/r/regression Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ Release date: TBA
75
75
* Add ``is_sys_guard`` and ``is_typing_guard`` helper functions from astroid
76
76
to ``pylint.checkers.utils``.
77
77
78
+ * Fix regression on ClassDef inference
79
+
80
+ Closes #5030
81
+ Closes #5036
82
+
78
83
79
84
What's New in Pylint 2.11.1?
80
85
============================
Original file line number Diff line number Diff line change
1
+ """Regression in astroid on ClassDef inference with two test cases.
2
+ Fixed in https://github.com/PyCQA/astroid/pull/1181"""
3
+
4
+ from typing import Tuple , Type
5
+ from typing import Dict , List , Any
6
+ from dataclasses import dataclass , field
7
+
8
+ # https://github.com/PyCQA/pylint/issues/5030
9
+ def is_type_list (f_type : Type ) -> bool :
10
+ """just here to show the issue"""
11
+ return f_type == list
12
+
13
+ assert not is_type_list (Tuple )
14
+
15
+
16
+ # https://github.com/PyCQA/pylint/issues/5036
17
+ @dataclass
18
+ class SomeData :
19
+ """A dataclass."""
20
+ a_dict : Dict [str , List [str ]] = field (default_factory = dict )
21
+
22
+
23
+ @dataclass
24
+ class SubSomeData (SomeData ):
25
+ """A subclass of a dataclass."""
26
+
27
+ def __init__ (self , ** kwargs : Dict [str , Any ]) -> None :
28
+ """Subclass init func."""
29
+ super ().__init__ (** kwargs )
30
+ if "test" in self .a_dict :
31
+ print (self .a_dict ["test" ])
Original file line number Diff line number Diff line change
1
+ [testoptions]
2
+ min_pyver=3.7
You can’t perform that action at this time.
0 commit comments