I don't think this change is needed. This code is used in FormattedString and Url to ensure we have a mapping that can be used with kwargs to format the string/url, and should specifically check that the object passed has dict-like behavior. Your set test passes without it.