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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/rhettinger'closed_at=<Date2016-07-07.21:52:50.632>created_at=<Date2016-06-04.17:07:44.346>labels= ['type-feature', 'library']
title="Add a pure Python version of 'collections.defaultdict'"updated_at=<Date2016-07-07.22:13:05.112>user='https://github.com/Vgr255'
Attached patch adds a pure Python version of collections.defaultdict. This is yet another step in providing better support for alternate implementations, which may or may not have _collections.
I also went ahead and fixed all so that from collections import * doesn't fail if 'deque' isn't present (which it may not be in alternate implementations).
Patch includes (small) doc and test changes. All tests pass successfully for both versions.
I don't think there is any advantage to adding a pure python version of defaultdict (or we would have done it a long time ago). Each time we do this, it creates a host of downstream issues where people notice minor implementation differences between the two.
I agree that CPython itself gains nothing from having this, as this is so that alternate implementations have it as well. I get what you mean about the minor differences, however I think it's a good thing, as it helps to make sure the tests are precise enough so that there can't be any differences (but that's probably just me).
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: