Repository navigation
stdlib/2and3/builtins: change dict.fromkeys to classmethod - #3798
Conversation
The referenced issue in mypy is fixed.
6c55ac5 to
39a6689
Compare
|
What difference does this actually make? The only observable difference I can think of is that classmethods can return an instance of a subclass if called on a subclass, and that's indeed what happens if you call The docs (https://docs.python.org/3.8/library/stdtypes.html#dict.fromkeys) do call the method a classmethod, so I'm happy to merge this PR as is, but I'm just curious whether this solves some concrete problem. |
|
@JelleZijlstra This indeed started in an attempt to make the Since we won't be going this route, I can change this PR to just drop the TODO note instead. Though it does seem better to keep the door open for generic self, so I do slightly prefer to merge as-is. |
|
Sounds good, I merged it. |
The referenced issue python/mypy#328 is fixed.