@@ -304,49 +304,46 @@ def __repr__(self):
304304 self ._format_all ()
305305 return repr (self .data )
306306
307- if config .PY_VERSION >= version .parse ("3.9" ):
308- # merging with the union ("|") operator is supported in Python 3.9+
309-
310- def __or__ (self , other ):
311- if isinstance (other , LazyDict ):
312- inst = self .copy ()
313- other = other .copy ()
314- other ._format_all ()
315- inst .keys_to_format -= other .data .keys ()
316- inst .data = inst .data | other .data
317- return inst
318- if isinstance (other , dict ):
319- inst = self .copy ()
320- inst .keys_to_format -= other .keys ()
321- inst .data = inst .data | other
322- return inst
323- return NotImplemented
324-
325- def __ror__ (self , other ):
326- if isinstance (other , LazyDict ):
327- inst = self .copy ()
328- other = other .copy ()
329- other ._format_all ()
330- inst .keys_to_format -= other .data .keys ()
331- inst .data = other .data | inst .data
332- return inst
333- if isinstance (other , dict ):
334- inst = self .copy ()
335- inst .keys_to_format -= other .keys ()
336- inst .data = other | inst .data
337- return inst
338- return NotImplemented
339-
340- def __ior__ (self , other ):
341- if isinstance (other , LazyDict ):
342- other = other .copy ()
343- other ._format_all ()
344- self .keys_to_format -= other .data .keys ()
345- self .data |= other .data
346- else :
347- self .keys_to_format -= other .keys ()
348- self .data |= other
349- return self
307+ def __or__ (self , other ):
308+ if isinstance (other , LazyDict ):
309+ inst = self .copy ()
310+ other = other .copy ()
311+ other ._format_all ()
312+ inst .keys_to_format -= other .data .keys ()
313+ inst .data = inst .data | other .data
314+ return inst
315+ if isinstance (other , dict ):
316+ inst = self .copy ()
317+ inst .keys_to_format -= other .keys ()
318+ inst .data = inst .data | other
319+ return inst
320+ return NotImplemented
321+
322+ def __ror__ (self , other ):
323+ if isinstance (other , LazyDict ):
324+ inst = self .copy ()
325+ other = other .copy ()
326+ other ._format_all ()
327+ inst .keys_to_format -= other .data .keys ()
328+ inst .data = other .data | inst .data
329+ return inst
330+ if isinstance (other , dict ):
331+ inst = self .copy ()
332+ inst .keys_to_format -= other .keys ()
333+ inst .data = other | inst .data
334+ return inst
335+ return NotImplemented
336+
337+ def __ior__ (self , other ):
338+ if isinstance (other , LazyDict ):
339+ other = other .copy ()
340+ other ._format_all ()
341+ self .keys_to_format -= other .data .keys ()
342+ self .data |= other .data
343+ else :
344+ self .keys_to_format -= other .keys ()
345+ self .data |= other
346+ return self
350347
351348 def __copy__ (self ):
352349 # Identical to `UserDict.__copy__`
0 commit comments