@@ -122,20 +122,28 @@ class Environment(TypedDict):
122122 """
123123
124124
125+ def _normalize_extras (
126+ result : MarkerList | MarkerAtom | str ,
127+ ) -> MarkerList | MarkerAtom | str :
128+ if not isinstance (result , tuple ):
129+ return result
130+
131+ lhs , op , rhs = result
132+ if isinstance (lhs , Variable ) and lhs .value == "extra" :
133+ normalized_extra = canonicalize_name (rhs .value )
134+ rhs = Value (normalized_extra )
135+ elif isinstance (rhs , Variable ) and rhs .value == "extra" :
136+ normalized_extra = canonicalize_name (lhs .value )
137+ lhs = Value (normalized_extra )
138+ return lhs , op , rhs
139+
140+
125141def _normalize_extra_values (results : MarkerList ) -> MarkerList :
126142 """
127143 Normalize extra values.
128144 """
129- if isinstance (results [0 ], tuple ):
130- lhs , op , rhs = results [0 ]
131- if isinstance (lhs , Variable ) and lhs .value == "extra" :
132- normalized_extra = canonicalize_name (rhs .value )
133- rhs = Value (normalized_extra )
134- elif isinstance (rhs , Variable ) and rhs .value == "extra" :
135- normalized_extra = canonicalize_name (lhs .value )
136- lhs = Value (normalized_extra )
137- results [0 ] = lhs , op , rhs
138- return results
145+
146+ return [_normalize_extras (r ) for r in results ]
139147
140148
141149def _format_marker (
0 commit comments