(ch)
return i
Returns the unicode block number for ch, or None if ch has no block.

    >>> blocknum(u'a')
    0
    >>> blocknum(unichr(0x0b80))
    22
    >>> blocknum(unichr(2048))
    None
Returns the unicode block number for ch, or None if ch has no block.
Returns the unicode block number for ch or None if ch has no block .
def blocknum(ch):
    """Returns the unicode block number for ch, or None if ch has no block.

    >>> blocknum(u'a')
    0
    >>> blocknum(unichr(0x0b80))
    22
    >>> blocknum(unichr(2048))
    None
    """

    cp = ord(ch)
    i = bisect_right(_starts, cp) - 1
    end = _ends[i]
    if cp > end:
        return None
    return i
def blocknum ( ch ) : cp = ord ( ch ) i = bisect_right ( _starts , cp ) - 1 end = _ends [ i ] if cp > end : return None return i