Returns total number of items in bag. >>> b = Bag.fromkeys("abacab") >>> b.size 6
(self)
| 385 | __slots__ = [] |
| 386 | |
| 387 | def _size(self): |
| 388 | """Returns total number of items in bag. |
| 389 | |
| 390 | >>> b = Bag.fromkeys("abacab") |
| 391 | >>> b.size |
| 392 | 6 |
| 393 | """ |
| 394 | return sum(self.values()) |
| 395 | |
| 396 | size = property(_size, None, None, "Sum of all bag values.") |
| 397 |