Skip to content
Snippets Groups Projects
  • Florian Maury's avatar
    Adding callbacks to EnumField and lots of EnumField tests · c8261e4d
    Florian Maury authored
      - this feature allows conversion of large ranges where
        all entries coalesce to the same representation without bloating
        a dict. For instance, 0x0 to 0xffff all display as "toto" except
        a few odds 0x2 which are displayed as "tutu".
        Before this feature, you needed to write
        enum = {x: 'toto' for x in xrange(0, 0xffff)
        enum[2] = 'tutu'
        XShortEnumField('test', 0, enum)
    c8261e4d