Skip to content

Counter() support non-int #3438

@manu3618

Description

@manu3618

I'm quite surprised because I can use a Counter to store non-integer values. Is it a feature or just permissiveness in implementation?

E.g. the following code works (tested on python 3.7.4):

from collections import Counter

spam = Counter()
spam["egg"] += 3.4

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions