File tree 3 files changed +7
-5
lines changed
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:
81
81
"""
82
82
Return whatever is passed in
83
83
"""
84
- return args if len (args ) > 1 else args [ 0 ]
84
+ return args [ 0 ] if len (args ) == 1 else args
85
85
86
86
87
87
def match (
Original file line number Diff line number Diff line change @@ -120,12 +120,12 @@ def get_scale_view(
120
120
trans ,
121
121
# TODO: fix typecheck
122
122
sv .breaks , # type: ignore
123
- sv .range , # type: ignore
123
+ sv .range ,
124
124
)
125
125
sv .minor_breaks = transform_value (
126
126
trans ,
127
127
sv .minor_breaks ,
128
- sv .range , # type: ignore
128
+ sv .range ,
129
129
)
130
130
return sv
131
131
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ class ColorOrColour(Protocol):
21
21
colour : Any
22
22
23
23
THasAesNames = TypeVar (
24
- "THasAesNames" , bound = Sequence [str ] | dict [str , Any ] | ColorOrColour
24
+ "THasAesNames" ,
25
+ bound = Sequence [str ] | dict [str , Any ] | ColorOrColour ,
25
26
)
26
27
27
28
__all__ = ("aes" ,)
@@ -347,7 +348,8 @@ def rename_aesthetics(obj: THasAesNames) -> THasAesNames:
347
348
if name != new_name :
348
349
obj [new_name ] = obj .pop (name )
349
350
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
351
353
elif obj .color is None and obj .colour is not None :
352
354
obj .color , obj .colour = obj .colour , None
353
355
You can’t perform that action at this time.
0 commit comments