1313import  typing  as  t 
1414
1515from  narwhals ._plan .common  import  ExprIR 
16+ from  narwhals ._plan .typing  import  FunctionT , LeftT , OperatorT , RightT , RollingT 
1617
1718if  t .TYPE_CHECKING :
1819    from  typing_extensions  import  Self 
1920
20-     from  narwhals ._plan .common  import  Function , Seq 
21-     from  narwhals ._plan .functions  import  (
22-         MapBatches ,  # noqa: F401 
23-         RollingWindow ,
24-     )
21+     from  narwhals ._plan .common  import  Seq 
22+     from  narwhals ._plan .functions  import  MapBatches   # noqa: F401 
2523    from  narwhals ._plan .literal  import  LiteralValue 
26-     from  narwhals ._plan .operators  import  Operator 
2724    from  narwhals ._plan .options  import  FunctionOptions , SortMultipleOptions , SortOptions 
2825    from  narwhals ._plan .window  import  Window 
2926    from  narwhals .dtypes  import  DType 
3027
31- _FunctionT  =  t .TypeVar ("_FunctionT" , bound = "Function" )
32- _RollingT  =  t .TypeVar ("_RollingT" , bound = "RollingWindow" )
33- 
3428
3529class  Alias (ExprIR ):
3630    __slots__  =  ("expr" , "name" )
@@ -95,7 +89,7 @@ def __repr__(self) -> str:
9589        return  f"lit({ self .value !r}  )" 
9690
9791
98- class  BinaryExpr (ExprIR ):
92+ class  BinaryExpr (ExprIR ,  t . Generic [ LeftT ,  OperatorT ,  RightT ] ):
9993    """Application of two exprs via an `Operator`. 
10094
10195    This ✅ 
@@ -107,9 +101,9 @@ class BinaryExpr(ExprIR):
107101
108102    __slots__  =  ("left" , "op" , "right" )
109103
110-     left : ExprIR 
111-     op : Operator 
112-     right : ExprIR 
104+     left : LeftT 
105+     op : OperatorT 
106+     right : RightT 
113107
114108    @property  
115109    def  is_scalar (self ) ->  bool :
@@ -203,7 +197,7 @@ def iter_right(self) -> t.Iterator[ExprIR]:
203197        yield  from  self .expr .iter_right ()
204198
205199
206- class  FunctionExpr (ExprIR , t .Generic [_FunctionT ]):
200+ class  FunctionExpr (ExprIR , t .Generic [FunctionT ]):
207201    """**Representing `Expr::Function`**. 
208202
209203    https://github.com/pola-rs/polars/blob/dafd0a2d0e32b52bcfa4273bffdd6071a0d5977a/crates/polars-plan/src/dsl/expr.rs#L114-L120 
@@ -214,7 +208,7 @@ class FunctionExpr(ExprIR, t.Generic[_FunctionT]):
214208    __slots__  =  ("function" , "input" , "options" )
215209
216210    input : Seq [ExprIR ]
217-     function : _FunctionT 
211+     function : FunctionT 
218212    """Enum type is named `FunctionExpr` in `polars`. 
219213
220214    Mirroring *exactly* doesn't make much sense in OOP. 
@@ -257,7 +251,7 @@ def iter_right(self) -> t.Iterator[ExprIR]:
257251            yield  from  e .iter_right ()
258252
259253
260- class  RollingExpr (FunctionExpr [_RollingT ]): ...
254+ class  RollingExpr (FunctionExpr [RollingT ]): ...
261255
262256
263257class  AnonymousExpr (FunctionExpr ["MapBatches" ]):
0 commit comments