@@ -44,12 +44,12 @@ def resolve(
4444
4545 from_float = Fraction .from_float
4646 total_fraction = from_float (
47- sum (scalar .value for scalar , fraction in resolved if fraction is None )
47+ sum ([ scalar .value for scalar , fraction in resolved if fraction is None ] )
4848 )
4949
5050 if total_fraction :
5151 total_gutter = gutter * (len (dimensions ) - 1 )
52- consumed = sum (fraction for _ , fraction in resolved if fraction is not None )
52+ consumed = sum ([ fraction for _ , fraction in resolved if fraction is not None ] )
5353 remaining = max (Fraction (0 ), Fraction (total - total_gutter ) - consumed )
5454 fraction_unit = Fraction (remaining , total_fraction )
5555 resolved_fractions = [
@@ -118,23 +118,21 @@ def resolve_box_models(
118118 ]
119119
120120 if dimension == "width" :
121- total_remaining = sum (
122- box_model .width for box_model in box_models if box_model is not None
123- )
121+ total_remaining = sum ([width for width , _ , _ in filter (None , box_models )])
124122 remaining_space = max (0 , size .width - total_remaining - margin_width )
125123 else :
126- total_remaining = sum (
127- box_model .height for box_model in box_models if box_model is not None
128- )
124+ total_remaining = sum ([height for _ , height , _ in filter (None , box_models )])
129125 remaining_space = max (0 , size .height - total_remaining - margin_height )
130126
131127 fraction_unit = Fraction (
132128 remaining_space ,
133129 int (
134130 sum (
135- dimension .value
136- for dimension in dimensions
137- if dimension and dimension .is_fraction
131+ [
132+ dimension .value
133+ for dimension in dimensions
134+ if dimension and dimension .is_fraction
135+ ]
138136 )
139137 )
140138 or 1 ,
0 commit comments