Returns whether match should be shown based on current if current is _, True if match starts with 0 or 1 underscore if current is __, True regardless of match otherwise True if match does not start with any underscore
(current: str, match: str)
| 180 | |
| 181 | |
| 182 | def _few_enough_underscores(current: str, match: str) -> bool: |
| 183 | """Returns whether match should be shown based on current |
| 184 | |
| 185 | if current is _, True if match starts with 0 or 1 underscore |
| 186 | if current is __, True regardless of match |
| 187 | otherwise True if match does not start with any underscore |
| 188 | """ |
| 189 | if current.startswith("__"): |
| 190 | return True |
| 191 | elif current.startswith("_") and not match.startswith("__"): |
| 192 | return True |
| 193 | return not match.startswith("_") |
| 194 | |
| 195 | |
| 196 | def _method_match_none(word: str, size: int, text: str) -> bool: |