Commit Graph

2 Commits

Author SHA1 Message Date
Florian Maury c8261e4dc7 Adding callbacks to EnumField and lots of EnumField tests
- 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)
2017-02-07 10:18:43 +01:00
Florian Maury 784f44c880 Moving into another file the unit tests related to fields 2017-02-07 10:18:41 +01:00