Checks whether `chars` is a control character.
(char)
| 57 | |
| 58 | |
| 59 | def _is_control(char): |
| 60 | """Checks whether `chars` is a control character.""" |
| 61 | # These are technically control characters but we count them as whitespace |
| 62 | # characters. |
| 63 | if char == "\t" or char == "\n" or char == "\r": |
| 64 | return False |
| 65 | cat = unicodedata.category(char) |
| 66 | if cat.startswith("C"): |
| 67 | return True |
| 68 | return False |
| 69 | |
| 70 | |
| 71 | def _is_punctuation(char): |
no outgoing calls
no test coverage detected