You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not sure how this would look, but I can see people that already use enums for "status handling" (or similar stuff) wanting the features status map provides.
we might tackle this with a enum-like interface:
fromstatus_map.enumimportStatusEnum# this should be compatible with std lib's enum.EnumclassTaskEnum(StatusEnum):
TODO=0# there might be a better way to do this in the std libDOING=1DONE=2
The issue here is: how do we handle the transitions having an interface like that?
We might appeal to a django-like Meta class (I'm not really a fan of it though):
Another possibility is to bet on a more of a "freestyle" method:
classTaskEnum(StatusEnum):
TODO=0, 'task waiting for someone work on it', ['DOING']
DOING=1, 'task in progess', ['TODO', 'DONE"]
DONE=2, 'task ready!', [] # adding the possibility to the user describe what each status means
It's not very intuitive but at the same time not complicated. With this approach I think we save a lot of code and can even add some meaning to all this. And it's not too difficult to implement if we use the aenum [1] lib.
Those two were the best alternatives I could think of, but there might be better ideas.
not sure how this would look, but I can see people that already use enums for "status handling" (or similar stuff) wanting the features status map provides.
we might tackle this with a enum-like interface:
The issue here is: how do we handle the transitions having an interface like that?
We might appeal to a django-like Meta class (I'm not really a fan of it though):
Another possibility is to bet on a more of a "freestyle" method:
It's not very intuitive but at the same time not complicated. With this approach I think we save a lot of code and can even add some meaning to all this. And it's not too difficult to implement if we use the aenum [1] lib.
Those two were the best alternatives I could think of, but there might be better ideas.
[1] https://bitbucket.org/stoneleaf/aenum/
The text was updated successfully, but these errors were encountered: