Counts references to 'item' in a caseless manner. If item is not a string it will always return 0.
(self, item)
| 83 | list.append(self, entry) |
| 84 | |
| 85 | def count(self, item): |
| 86 | """Counts references to 'item' in a caseless manner. |
| 87 | If item is not a string it will always return 0.""" |
| 88 | if not isinstance(item, str): return 0 |
| 89 | count = 0 |
| 90 | for entry in self: |
| 91 | if item.lower() == entry.lower(): |
| 92 | count += 1 |
| 93 | return count |
| 94 | |
| 95 | def index(self, item, minindex=0, maxindex=None): |
| 96 | """Provide an index of first occurence of item in the list. (or raise a ValueError if item not present) |
no test coverage detected