by Znafon · 6y ago · 0 comments
defaultdict(callback,{**a,**b})
is more readable than a | b without knowing that a or b are defaultdicts and having to reason about which default callback will be usedJust override ‘__and__’ in your whatever class to replace default return.
Pretty explicit in my book.
making the trick work with other mapping types and making it faster is totally understandable though.