@@ -95,7 +95,7 @@ use crate::types::function::{
9595use crate :: types:: generics:: GenericContext ;
9696use crate :: types:: mro:: MroErrorKind ;
9797use crate :: types:: signatures:: { CallableSignature , Signature } ;
98- use crate :: types:: tuple:: { Tuple , TupleType } ;
98+ use crate :: types:: tuple:: { TupleSpec , TupleType } ;
9999use crate :: types:: unpacker:: { UnpackResult , Unpacker } ;
100100use crate :: types:: {
101101 BareTypeAliasType , CallDunderError , CallableType , ClassLiteral , ClassType , DataclassParams ,
@@ -7862,16 +7862,16 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
78627862 /// see `<https://github.com/python/cpython/blob/9d6366b60d01305fc5e45100e0cd13e358aa397d/Objects/tupleobject.c#L637>`
78637863 fn infer_tuple_rich_comparison (
78647864 & mut self ,
7865- left : & Tuple < ' db > ,
7865+ left : & TupleSpec < ' db > ,
78667866 op : RichCompareOperator ,
7867- right : & Tuple < ' db > ,
7867+ right : & TupleSpec < ' db > ,
78687868 range : TextRange ,
78697869 ) -> Result < Type < ' db > , CompareUnsupportedError < ' db > > {
78707870 // If either tuple is variable length, we can make no assumptions about the relative
78717871 // lengths of the tuples, and therefore neither about how they compare lexicographically.
78727872 // TODO: Consider comparing the prefixes of the tuples, since that could give a comparison
78737873 // result regardless of how long the variable-length tuple is.
7874- let ( Tuple :: Fixed ( left) , Tuple :: Fixed ( right) ) = ( left, right) else {
7874+ let ( TupleSpec :: Fixed ( left) , TupleSpec :: Fixed ( right) ) = ( left, right) else {
78757875 return Ok ( Type :: unknown ( ) ) ;
78767876 } ;
78777877
@@ -8116,7 +8116,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
81168116 }
81178117 // Ex) Given `("a", 1, Null)[0:2]`, return `("a", 1)`
81188118 ( Type :: Tuple ( tuple_ty) , _, Some ( SliceLiteral { start, stop, step } ) ) => {
8119- let Tuple :: Fixed ( tuple) = tuple_ty. tuple ( self . db ( ) ) else {
8119+ let TupleSpec :: Fixed ( tuple) = tuple_ty. tuple ( self . db ( ) ) else {
81208120 return todo_type ! ( "slice into variable-length tuple" ) ;
81218121 } ;
81228122
@@ -8210,7 +8210,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
82108210 Type :: IntLiteral ( i64:: from ( bool) ) ,
82118211 ) ,
82128212 ( Type :: SpecialForm ( SpecialFormType :: Protocol ) , Type :: Tuple ( typevars) , _) => {
8213- let Tuple :: Fixed ( typevars) = typevars. tuple ( self . db ( ) ) else {
8213+ let TupleSpec :: Fixed ( typevars) = typevars. tuple ( self . db ( ) ) else {
82148214 // TODO: emit a diagnostic
82158215 return Type :: unknown ( ) ;
82168216 } ;
@@ -8235,7 +8235,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
82358235 todo_type ! ( "doubly-specialized typing.Protocol" )
82368236 }
82378237 ( Type :: SpecialForm ( SpecialFormType :: Generic ) , Type :: Tuple ( typevars) , _) => {
8238- let Tuple :: Fixed ( typevars) = typevars. tuple ( self . db ( ) ) else {
8238+ let TupleSpec :: Fixed ( typevars) = typevars. tuple ( self . db ( ) ) else {
82398239 // TODO: emit a diagnostic
82408240 return Type :: unknown ( ) ;
82418241 } ;
@@ -9229,7 +9229,7 @@ impl<'db> TypeInferenceBuilder<'db, '_> {
92299229 return result;
92309230 }
92319231
9232- let mut element_types = Tuple :: with_capacity ( elements. len ( ) ) ;
9232+ let mut element_types = TupleSpec :: with_capacity ( elements. len ( ) ) ;
92339233
92349234 // Whether to infer `Todo` for the whole tuple
92359235 // (see docstring for `element_could_alter_type_of_whole_tuple`)
0 commit comments