File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def identity(*args: Any) -> Any:
8181 """
8282 Return whatever is passed in
8383 """
84- return args if len (args ) > 1 else args [ 0 ]
84+ return args [ 0 ] if len (args ) == 1 else args
8585
8686
8787def match (
Original file line number Diff line number Diff line change @@ -120,12 +120,12 @@ def get_scale_view(
120120 trans ,
121121 # TODO: fix typecheck
122122 sv .breaks , # type: ignore
123- sv .range , # type: ignore
123+ sv .range ,
124124 )
125125 sv .minor_breaks = transform_value (
126126 trans ,
127127 sv .minor_breaks ,
128- sv .range , # type: ignore
128+ sv .range ,
129129 )
130130 return sv
131131
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ class ColorOrColour(Protocol):
2121 colour : Any
2222
2323 THasAesNames = TypeVar (
24- "THasAesNames" , bound = Sequence [str ] | dict [str , Any ] | ColorOrColour
24+ "THasAesNames" ,
25+ bound = Sequence [str ] | dict [str , Any ] | ColorOrColour ,
2526 )
2627
2728__all__ = ("aes" ,)
@@ -347,7 +348,8 @@ def rename_aesthetics(obj: THasAesNames) -> THasAesNames:
347348 if name != new_name :
348349 obj [new_name ] = obj .pop (name )
349350 elif isinstance (obj , Sequence ):
350- return type (obj )(s .replace ("colour" , "color" ) for s in obj )
351+ T = type (obj )
352+ return T (s .replace ("colour" , "color" ) for s in obj ) # pyright: ignore
351353 elif obj .color is None and obj .colour is not None :
352354 obj .color , obj .colour = obj .colour , None
353355
You can’t perform that action at this time.
0 commit comments