Next / Previous / Contents / Shipman's homepage

6.16. class UniBlock: One Unicode code block

Each instance of this class represents one of the chunks of code point space handed out by the Unicode Consortium. A block's length is always a multiple of 16.

Because the source of all this data is a node in the unicode.xml file, all the constructor needs is that node as an et.Element.

unidata.py
# - - - - -   c l a s s   U n i B l o c k

class UniBlock(object):
    '''Represents a named range of code points.

      UniBlock(node):
        [ node is a BLOCK_N et.Element ->
            return a new UniBlock instance representing node ]
      .name:       [ NAME_A attribute ]
      .start:      [ START_A attribute as an int ]
      .end:        [ END_A attribute as an int ]
    '''