[Chandler-dev] a new kind of enumeration type

Andi Vajda vajda at osafoundation.org
Wed Aug 30 15:41:32 PDT 2006


On Wed, 30 Aug 2006, Grant Baillie wrote:

> The backward compatibility point is a good one. BTW, if in 5 we decide we 
> need a "soon" between "now" and "later", would
>
>       values = {"now": 0, "later": 1, "done": -1, "soon": 0.5}

Yes, the value can be any literal. 0.5 is fine.
You could also change all the values to spread them if you wanted to stick to 
integers.

With the current implementation, the value that is persisted is not guaranteed 
to be constant across schema versions. I could change that by persisting the 
name of the constant instead of its position in the sorted-by-name constants 
list at the cost of a few more bytes (depending on the length of the constant 
names) if that matters.

Andi..


More information about the chandler-dev mailing list