Skip to content

k-nut/counter-reimplemented

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

#Counter - reimplemented

A small reimplementation of Python's Counter Class feature that lets you increment values in a dictionary like object without having to check if they are there.

c = Counter()
c['foobar'] += 1 # Note: No KeyError here!
assert c['foobar'] == 1

Setup

Install py.test (and pytest-watch) and run the test. Run ptw . to rereun the tets whenever a files changes

pip install -r requirements.txt

Other

Originally presented at Berlin Hack and Tell #43

About

A small reimplementation of one of some features of python's collections.Counter class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages