(char)
return False
Checks whether `chars` is a punctuation character.
Checks whether `chars` is a punctuation character.
Checks whether chars is a punctuation character .
def _is_punctuation(char):
    """Checks whether `chars` is a punctuation character."""
    cp = ord(char)
    # We treat all non-letter/number ASCII as punctuation.
    # Characters such as "^", "$", and "`" are not in the Unicode
    # Punctuation class but we treat them as punctuation anyways, for
    # consistency.
    if (33 <= cp <= 47) or (58 <= cp <= 64) or (91 <= cp <= 96) or (123 <= cp <= 126):
        return True
    cat = unicodedata.category(char)
    if cat.startswith("P"):
        return True
    return False
def _is_punctuation ( char ) : cp = ord ( char ) # We treat all non-letter/number ASCII as punctuation. # Characters such as "^", "$", and "`" are not in the Unicode # Punctuation class but we treat them as punctuation anyways, for # consistency. if ( 33 <= cp <= 47 ) or ( 58 <= cp <= 64 ) or ( 91 <= cp <= 96 ) or ( 123 <= cp <= 126 ) : return True cat = unicodedata . category ( char ) if cat . startswith ( "P" ) : return True return False