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
OrderedDict.fromkeys() returns Dict instead of OrderedDict #3800
Wow, I didn't know of that trick (defining a typevar within the class) to make the key type work. I can't think of a way to make the value type work correctly either.
I think we should just add a stub for OrderedDict.fromkeys and not worry about other possible dict subclasses unless user reports come in that indicate that it's a common problem.
I think we should just add a stub for OrderedDict.fromkeys and not worry about other possible dict subclasses unless user reports come in that indicate that it's a common problem.
Sure. I'll do that after #3799 is settled to avoid a (semantic) conflict.
Activity
JelleZijlstra commentedon Mar 2, 2020
Wow, I didn't know of that trick (defining a typevar within the class) to make the key type work. I can't think of a way to make the value type work correctly either.
I think we should just add a stub for
OrderedDict.fromkeysand not worry about other possible dict subclasses unless user reports come in that indicate that it's a common problem.bluetech commentedon Mar 5, 2020
Sure. I'll do that after #3799 is settled to avoid a (semantic) conflict.
ssbarnea commentedon Jul 25, 2020
Is there a temporary workaround that we can use until this is sorted?
Add `OrderedDict.fromkeys`