Skip to content

Conversation

@reachtarunhere
Copy link
Collaborator

Problem
The following is the fix as per the suggestion in #12 which suggests
The collections.defaultdict class http://docs.python.org/library/collections.html#collections.defaultdict
could be used for Python 2.5+ rather than the method in utils.py

Solution:
The DefaultDict function implementation does the above and also maintains backward compatibility taking into account the fact that the native implementation in 2.5+ requires a callable for setting default values and the original implementation made use of non callables like 0 or []. The implementation allows using both a callable or the previous method.

@reachtarunhere
Copy link
Collaborator Author

I am closing this since I don't feel that this is relevant anymore given we are ok with breaking compatibility for the main branch. Though it might be a good idea to add this to the legacy branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant