You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CountsView as a Collection of (element, count) tuples isn't very Pythonic. Iterating is okay, but __contains__ is stupid - why would you want to check (element, count) in bag.counts().
CountsView as a Mapping seems much more intuitive. This would be a backwards-incompatible, breaking change.
This discussion was converted from issue #179 on July 15, 2022 23:53.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
CountsView as a Collection of (element, count) tuples isn't very Pythonic. Iterating is okay, but
__contains__
is stupid - why would you want to check(element, count) in bag.counts()
.CountsView as a Mapping seems much more intuitive. This would be a backwards-incompatible, breaking change.
Beta Was this translation helpful? Give feedback.
All reactions