File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 16
16
Callable ,
17
17
ClassVar ,
18
18
Generator ,
19
+ Iterator ,
19
20
Optional ,
20
21
Type ,
21
22
TypeVar ,
@@ -4876,7 +4877,9 @@ def __init__(
4876
4877
parent = self .original .parent ,
4877
4878
)
4878
4879
4879
- def infer (self , context = None , ** kwargs ):
4880
+ def _infer (
4881
+ self , context : Optional [InferenceContext ] = None
4882
+ ) -> Iterator [Union [NodeNG , Type [util .Uninferable ]]]:
4880
4883
yield self .value
4881
4884
4882
4885
Original file line number Diff line number Diff line change 12
12
"""
13
13
14
14
import sys
15
+ from typing import Iterator , Optional , TypeVar
15
16
16
17
from astroid import bases , decorators , util
18
+ from astroid .context import InferenceContext
17
19
from astroid .exceptions import (
18
20
AttributeInferenceError ,
19
21
InferenceError ,
30
32
else :
31
33
from astroid .decorators import cachedproperty as cached_property
32
34
35
+ _T = TypeVar ("_T" )
36
+
33
37
34
38
class FrozenSet (node_classes .BaseContainer ):
35
39
"""class representing a FrozenSet composite node"""
@@ -324,5 +328,5 @@ def pytype(self):
324
328
def infer_call_result (self , caller = None , context = None ):
325
329
raise InferenceError ("Properties are not callable" )
326
330
327
- def infer (self , context = None , ** kwargs ) :
328
- return iter (( self ,))
331
+ def _infer (self : _T , context : Optional [ InferenceContext ] = None ) -> Iterator [ _T ] :
332
+ yield self
You can’t perform that action at this time.
0 commit comments