File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ dependencies = [
13
13
" invoke" ,
14
14
# lint
15
15
" black" ,
16
- " ruff" ,
16
+ " ruff==0.0.278 " , # Ruff is moving really fast, so pinning for now.
17
17
" toml" ,
18
18
" flake8" ,
19
19
" flake8-pyproject" ,
Original file line number Diff line number Diff line change @@ -62,21 +62,21 @@ def render(self) -> VdomDict | ComponentType | str | None:
62
62
"""Render the component's view model."""
63
63
64
64
65
- _Render = TypeVar ("_Render " , covariant = True )
66
- _Event = TypeVar ("_Event " , contravariant = True )
65
+ _Render_co = TypeVar ("_Render_co " , covariant = True )
66
+ _Event_contra = TypeVar ("_Event_contra " , contravariant = True )
67
67
68
68
69
69
@runtime_checkable
70
- class LayoutType (Protocol [_Render , _Event ]):
70
+ class LayoutType (Protocol [_Render_co , _Event_contra ]):
71
71
"""Renders and delivers, updates to views and events to handlers, respectively"""
72
72
73
- async def render (self ) -> _Render :
73
+ async def render (self ) -> _Render_co :
74
74
"""Render an update to a view"""
75
75
76
- async def deliver (self , event : _Event ) -> None :
76
+ async def deliver (self , event : _Event_contra ) -> None :
77
77
"""Relay an event to its respective handler"""
78
78
79
- async def __aenter__ (self ) -> LayoutType [_Render , _Event ]:
79
+ async def __aenter__ (self ) -> LayoutType [_Render_co , _Event_contra ]:
80
80
"""Prepare the layout for its first render"""
81
81
82
82
async def __aexit__ (
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ def clear_reactpy_web_modules_dir() -> None:
25
25
26
26
_P = ParamSpec ("_P" )
27
27
_R = TypeVar ("_R" )
28
- _RC = TypeVar ("_RC" , covariant = True )
29
28
30
29
31
30
_DEFAULT_POLL_DELAY = 0.1
Original file line number Diff line number Diff line change @@ -78,11 +78,11 @@ def sync_inputs(event: dict[str, Any]) -> None:
78
78
return inputs
79
79
80
80
81
- _CastTo = TypeVar ("_CastTo " , covariant = True )
81
+ _CastTo_co = TypeVar ("_CastTo_co " , covariant = True )
82
82
83
83
84
- class _CastFunc (Protocol [_CastTo ]):
85
- def __call__ (self , value : str ) -> _CastTo :
84
+ class _CastFunc (Protocol [_CastTo_co ]):
85
+ def __call__ (self , value : str ) -> _CastTo_co :
86
86
...
87
87
88
88
You can’t perform that action at this time.
0 commit comments