"""Constants and membership tests for ASCII characters"""
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
"BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
"DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
"CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US",
def isalnum(c
): return isalpha(c
) or isdigit(c
)
def isalpha(c
): return isupper(c
) or islower(c
)
def isascii(c
): return _ctoi(c
) <= 127 # ?
def isblank(c
): return _ctoi(c
) in (8,32)
def iscntrl(c
): return _ctoi(c
) <= 31
def isdigit(c
): return _ctoi(c
) >= 48 and _ctoi(c
) <= 57
def isgraph(c
): return _ctoi(c
) >= 33 and _ctoi(c
) <= 126
def islower(c
): return _ctoi(c
) >= 97 and _ctoi(c
) <= 122
def isprint(c
): return _ctoi(c
) >= 32 and _ctoi(c
) <= 126
def ispunct(c
): return _ctoi(c
) != 32 and not isalnum(c
)
def isspace(c
): return _ctoi(c
) in (9, 10, 11, 12, 13, 32)
def isupper(c
): return _ctoi(c
) >= 65 and _ctoi(c
) <= 90
def isxdigit(c
): return isdigit(c
) or \
(_ctoi(c
) >= 65 and _ctoi(c
) <= 70) or (_ctoi(c
) >= 97 and _ctoi(c
) <= 102)
def isctrl(c
): return _ctoi(c
) < 32
def ismeta(c
): return _ctoi(c
) > 127
return chr(_ctoi(c
) & 0x7f)
return chr(_ctoi(c
) & 0x1f)
return chr(_ctoi(c
) |
0x80)
elif isprint(bits
& 0x7f):
rep
= "^" + chr(((bits
& 0x7f) |
0x20) + 0x20)