You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing update method on the CaseInsensitiveDict #7632
Thanks! The issue isn't that CaseInsensitiveDict doesn't have a .update() method, however — it does, it inherits it from MutableMapping. The issue is that CaseInsensitiveDict is currently marked as a TypeAlias assignment following 740193a#diff-bfcfcf0d08b5e5c2965394517079c5cfb2b2a11b2e27cf9d08fb07090cd9a4ceR32, meaning mypy is getting confused when you're trying to use it as a variable rather than as a type.
It's my mistake; I can send an alternative PR to fix it :)
Activity
AlexWaygood commentedon Apr 16, 2022
Thanks! The issue isn't that
CaseInsensitiveDictdoesn't have a.update()method, however — it does, it inherits it from MutableMapping. The issue is thatCaseInsensitiveDictis currently marked as aTypeAliasassignment following 740193a#diff-bfcfcf0d08b5e5c2965394517079c5cfb2b2a11b2e27cf9d08fb07090cd9a4ceR32, meaning mypy is getting confused when you're trying to use it as a variable rather than as a type.It's my mistake; I can send an alternative PR to fix it :)
Use re-exports instead of TypeAliases in several places
Fokko commentedon Apr 16, 2022
Thanks for the quick response and the background info @AlexWaygood. Feel free to send an alternative PR; you're the expert here :)
AlexWaygood commentedon Apr 16, 2022
#7634 should fix it, though I haven't tested it. I'm pretty sure the recent switch to using
TypeAliasin more places was the cause, though :)Use imports instead of TypeAliases in a couple places (#7634)