We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AtomicDict.reduce()
AtomicDict.aggregate()
Replicating collections.Counter would be made easier by the addition of aggregation methods:
collections.Counter
from cereggii import AtomicDict, NOT_FOUND d = AtomicDict() d.aggregate("spam", lambda current_value: 1 if current_value is NOT_FOUND else current_value + 1) batch = [ ("spam", 1), ("foo", 20), ] def count(key, current, new): if current is NOT_FOUND: return 1 return current + new d.reduce(batch, count)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Replicating
collections.Counter
would be made easier by the addition of aggregation methods:The text was updated successfully, but these errors were encountered: