Returns items sorted by value. >>> c = counter() >>> c.add('x') >>> c.add('x') >>> c.add('y') >>> c.sorted_items() [('x', 2), ('y', 1)]
(self)
| 264 | return [self[k] for k in self.sorted_keys()] |
| 265 | |
| 266 | def sorted_items(self): |
| 267 | """Returns items sorted by value. |
| 268 | |
| 269 | >>> c = counter() |
| 270 | >>> c.add('x') |
| 271 | >>> c.add('x') |
| 272 | >>> c.add('y') |
| 273 | >>> c.sorted_items() |
| 274 | [('x', 2), ('y', 1)] |
| 275 | """ |
| 276 | return [(k, self[k]) for k in self.sorted_keys()] |
| 277 | |
| 278 | def __repr__(self): |
| 279 | return "<Counter " + dict.__repr__(self) + ">" |
nothing calls this directly
no test coverage detected