File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ class Dimensions(Generic[WidthT, HeightT]):
31
31
DimensionsWithWidth = Dimensions [pyd .NonNegativeInt , pyd .NonNegativeInt | None ]
32
32
DimensionsWithHeight = Dimensions [pyd .NonNegativeInt | None , pyd .NonNegativeInt ]
33
33
DimensionsWithWidthAndHeight = Dimensions [pyd .NonNegativeInt , pyd .NonNegativeInt ]
34
+ DimensionsWithWidthOrHeight = DimensionsWithWidth | DimensionsWithHeight
34
35
AnyDimensions = (
35
36
GeneralDimensions | DimensionsWithWidth | DimensionsWithHeight | DimensionsWithWidthAndHeight )
36
37
@@ -47,6 +48,10 @@ def has_width_and_height(dims: AnyDimensions) -> TypeIs[DimensionsWithWidthAndHe
47
48
return has_width (dims ) and has_height (dims )
48
49
49
50
51
+ def has_width_or_height (dims : AnyDimensions ) -> TypeIs [DimensionsWithWidthOrHeight ]:
52
+ return has_width (dims ) or has_height (dims )
53
+
54
+
50
55
class Proportionally (str , Enum ):
51
56
THINNER = 'thinner'
52
57
SAME = 'same'
You can’t perform that action at this time.
0 commit comments