(self, loc)
| 2820 | class Document: |
| 2821 | |
| 2822 | def __contains__(self, loc) -> bool: |
| 2823 | if type(loc) is int: |
| 2824 | if loc < self.page_count: |
| 2825 | return True |
| 2826 | return False |
| 2827 | if type(loc) not in (tuple, list) or len(loc) != 2: |
| 2828 | return False |
| 2829 | chapter, pno = loc |
| 2830 | if (0 |
| 2831 | or not isinstance(chapter, int) |
| 2832 | or chapter < 0 |
| 2833 | or chapter >= self.chapter_count |
| 2834 | ): |
| 2835 | return False |
| 2836 | if (0 |
| 2837 | or not isinstance(pno, int) |
| 2838 | or pno < 0 |
| 2839 | or pno >= self.chapter_page_count(chapter) |
| 2840 | ): |
| 2841 | return False |
| 2842 | return True |
| 2843 | |
| 2844 | def __delitem__(self, i)->None: |
| 2845 | if not self.is_pdf: |
nothing calls this directly
no test coverage detected