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 = [
1313 " invoke" ,
1414 # lint
1515 " black" ,
16- " ruff" ,
16+ " ruff==0.0.278 " , # Ruff is moving really fast, so pinning for now.
1717 " toml" ,
1818 " flake8" ,
1919 " flake8-pyproject" ,
Original file line number Diff line number Diff line change @@ -62,21 +62,21 @@ def render(self) -> VdomDict | ComponentType | str | None:
6262 """Render the component's view model."""
6363
6464
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 )
6767
6868
6969@runtime_checkable
70- class LayoutType (Protocol [_Render , _Event ]):
70+ class LayoutType (Protocol [_Render_co , _Event_contra ]):
7171 """Renders and delivers, updates to views and events to handlers, respectively"""
7272
73- async def render (self ) -> _Render :
73+ async def render (self ) -> _Render_co :
7474 """Render an update to a view"""
7575
76- async def deliver (self , event : _Event ) -> None :
76+ async def deliver (self , event : _Event_contra ) -> None :
7777 """Relay an event to its respective handler"""
7878
79- async def __aenter__ (self ) -> LayoutType [_Render , _Event ]:
79+ async def __aenter__ (self ) -> LayoutType [_Render_co , _Event_contra ]:
8080 """Prepare the layout for its first render"""
8181
8282 async def __aexit__ (
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ def clear_reactpy_web_modules_dir() -> None:
2525
2626_P = ParamSpec ("_P" )
2727_R = TypeVar ("_R" )
28- _RC = TypeVar ("_RC" , covariant = True )
2928
3029
3130_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:
7878 return inputs
7979
8080
81- _CastTo = TypeVar ("_CastTo " , covariant = True )
81+ _CastTo_co = TypeVar ("_CastTo_co " , covariant = True )
8282
8383
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 :
8686 ...
8787
8888
You can’t perform that action at this time.
0 commit comments