• + 2 comments

    I think you have it dead on, for anybody who still doesn't understand how the ord(c) >> 5 part works, this is the binary representation of characters and digits:

    >>> bin(ord('0'))
    '0b0110000'
    >>> bin(ord('9'))
    '0b0111001'
    >>> bin(ord('A'))
    '0b1000001'
    >>> bin(ord('Z'))
    '0b1011010'
    >>> bin(ord('a'))
    '0b1100001'
    >>> bin(ord('z'))
    '0b1111010'
    

    The first 2 binary digits will separate the characters into digits, lower case, upper case. So right shifting the value of ord(c) will just give those digits, e.g.

    >>> bin(ord('a') >> 5)
    '0b11'
    which as conkosidowski says is 3 when represented as int.