@@ -2334,6 +2334,7 @@ pub enum KnownClass {
2334
2334
NamedTuple ,
2335
2335
NewType ,
2336
2336
SupportsIndex ,
2337
+ Iterable ,
2337
2338
// Collections
2338
2339
ChainMap ,
2339
2340
Counter ,
@@ -2426,6 +2427,7 @@ impl KnownClass {
2426
2427
| Self :: Float
2427
2428
| Self :: Enum
2428
2429
| Self :: ABCMeta
2430
+ | KnownClass :: Iterable
2429
2431
// Empty tuples are AlwaysFalse; non-empty tuples are AlwaysTrue
2430
2432
| Self :: NamedTuple
2431
2433
// Evaluating `NotImplementedType` in a boolean context was deprecated in Python 3.9
@@ -2513,6 +2515,7 @@ impl KnownClass {
2513
2515
| Self :: DefaultDict
2514
2516
| Self :: OrderedDict
2515
2517
| Self :: NewType
2518
+ | Self :: Iterable
2516
2519
| Self :: BaseExceptionGroup => false ,
2517
2520
}
2518
2521
}
@@ -2531,7 +2534,7 @@ impl KnownClass {
2531
2534
/// 2. It's probably more performant.
2532
2535
const fn is_protocol ( self ) -> bool {
2533
2536
match self {
2534
- Self :: SupportsIndex => true ,
2537
+ Self :: SupportsIndex | Self :: Iterable => true ,
2535
2538
2536
2539
Self :: Any
2537
2540
| Self :: Bool
@@ -2648,6 +2651,7 @@ impl KnownClass {
2648
2651
Self :: Enum => "Enum" ,
2649
2652
Self :: ABCMeta => "ABCMeta" ,
2650
2653
Self :: Super => "super" ,
2654
+ Self :: Iterable => "Iterable" ,
2651
2655
// For example, `typing.List` is defined as `List = _Alias()` in typeshed
2652
2656
Self :: StdlibAlias => "_Alias" ,
2653
2657
// This is the name the type of `sys.version_info` has in typeshed,
@@ -2882,6 +2886,7 @@ impl KnownClass {
2882
2886
| Self :: TypeVar
2883
2887
| Self :: NamedTuple
2884
2888
| Self :: StdlibAlias
2889
+ | Self :: Iterable
2885
2890
| Self :: SupportsIndex => KnownModule :: Typing ,
2886
2891
Self :: TypeAliasType
2887
2892
| Self :: TypeVarTuple
@@ -2984,6 +2989,7 @@ impl KnownClass {
2984
2989
| Self :: NewType
2985
2990
| Self :: Field
2986
2991
| Self :: KwOnly
2992
+ | Self :: Iterable
2987
2993
| Self :: NamedTupleFallback => false ,
2988
2994
}
2989
2995
}
@@ -3052,6 +3058,7 @@ impl KnownClass {
3052
3058
| Self :: NewType
3053
3059
| Self :: Field
3054
3060
| Self :: KwOnly
3061
+ | Self :: Iterable
3055
3062
| Self :: NamedTupleFallback => false ,
3056
3063
}
3057
3064
}
@@ -3101,6 +3108,7 @@ impl KnownClass {
3101
3108
"NewType" => Self :: NewType ,
3102
3109
"TypeAliasType" => Self :: TypeAliasType ,
3103
3110
"TypeVar" => Self :: TypeVar ,
3111
+ "Iterable" => Self :: Iterable ,
3104
3112
"ParamSpec" => Self :: ParamSpec ,
3105
3113
"ParamSpecArgs" => Self :: ParamSpecArgs ,
3106
3114
"ParamSpecKwargs" => Self :: ParamSpecKwargs ,
@@ -3197,6 +3205,7 @@ impl KnownClass {
3197
3205
| Self :: ParamSpecKwargs
3198
3206
| Self :: TypeVarTuple
3199
3207
| Self :: NamedTuple
3208
+ | Self :: Iterable
3200
3209
| Self :: NewType => matches ! ( module, KnownModule :: Typing | KnownModule :: TypingExtensions ) ,
3201
3210
}
3202
3211
}
0 commit comments