> On 20 Oct 2019, at 12:41, Steve Jorgensen <ste...@stevej.name> wrote:
> 
> Anders Hovmöller wrote:
>> We try to do the same thing in various libraries. We've settled on using 
>> existing
>> python and end up with syntax like:
>> class MyForm(Form):
>>    field = Field()
>> or in your case
>> class Colors(TokenContainer):
>>    red = Token()
>>    green = Token()
>>    blue = Token()
>> (this is using tri.token).
> 
> This seems like a good approach and is similar to the strategy Enum uses.

Site note: When we saw enums landing we hoped we could ditch tri.token but 
unfortunately enums have a bunch of limitations and restrictions that make them 
quite unusable for our more general use case :(
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/4PWGNTOGTZOWEXVVAIJ35736KDJTH576/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to