Visitar URL original
bpo-25478: Add scalar multiplication and division to Counter by rhettinger · Pull Request #6574 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20260217075426/https://github.com/python/cpython/pull/6574
Skip to content
/ cpython Public

bpo-25478: Add scalar multiplication and division to Counter#6574

Closed
rhettinger wants to merge 12 commits intopython:mainfrom
rhettinger:pmf
Closed

bpo-25478: Add scalar multiplication and division to Counter#6574
rhettinger wants to merge 12 commits intopython:mainfrom
rhettinger:pmf

Conversation

@rhettinger
Copy link
Contributor

@rhettinger rhettinger commented Apr 23, 2018 •

@rhettinger rhettinger added the type-feature A feature request or enhancement label Apr 23, 2018
return Counter({elem: count / x for elem, count in self.items()})

def __rtruediv__(self, x):
''' Divide a scalar by the counts '''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use case for this?

@rhettinger rhettinger closed this Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants