{"action":"created","issue":{"url":"https://api.github.com/repos/tyarkoni/transitions/issues/130","repository_url":"https://api.github.com/repos/tyarkoni/transitions","labels_url":"https://api.github.com/repos/tyarkoni/transitions/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/tyarkoni/transitions/issues/130/comments","events_url":"https://api.github.com/repos/tyarkoni/transitions/issues/130/events","html_url":"https://github.com/tyarkoni/transitions/issues/130","id":171325262,"number":130,"title":"Lack of support for final states. ","user":{"login":"thundergolfer","id":12058921,"avatar_url":"https://avatars.githubusercontent.com/u/12058921?v=3","gravatar_id":"","url":"https://api.github.com/users/thundergolfer","html_url":"https://github.com/thundergolfer","followers_url":"https://api.github.com/users/thundergolfer/followers","following_url":"https://api.github.com/users/thundergolfer/following{/other_user}","gists_url":"https://api.github.com/users/thundergolfer/gists{/gist_id}","starred_url":"https://api.github.com/users/thundergolfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thundergolfer/subscriptions","organizations_url":"https://api.github.com/users/thundergolfer/orgs","repos_url":"https://api.github.com/users/thundergolfer/repos","events_url":"https://api.github.com/users/thundergolfer/events{/privacy}","received_events_url":"https://api.github.com/users/thundergolfer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-16T05:01:24Z","updated_at":"2016-08-18T12:03:08Z","closed_at":null,"body":"I am currently using this library to implement some algorithms from a Computing Theory textbook, and though this library is great and full of features, you can't designate a set of 'final' or 'accepting' states which are needed for representing DFAs and NFAs in a theoretical context. \r\n\r\nYou may not want to incorporate this sort of thing into `core.py` but do you think it could find a place in the package? I might be better off forking and re-configuring this for theoretical use."},"comment":{"url":"https://api.github.com/repos/tyarkoni/transitions/issues/comments/240703085","html_url":"https://github.com/tyarkoni/transitions/issues/130#issuecomment-240703085","issue_url":"https://api.github.com/repos/tyarkoni/transitions/issues/130","id":240703085,"user":{"login":"aleneum","id":205986,"avatar_url":"https://avatars.githubusercontent.com/u/205986?v=3","gravatar_id":"","url":"https://api.github.com/users/aleneum","html_url":"https://github.com/aleneum","followers_url":"https://api.github.com/users/aleneum/followers","following_url":"https://api.github.com/users/aleneum/following{/other_user}","gists_url":"https://api.github.com/users/aleneum/gists{/gist_id}","starred_url":"https://api.github.com/users/aleneum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleneum/subscriptions","organizations_url":"https://api.github.com/users/aleneum/orgs","repos_url":"https://api.github.com/users/aleneum/repos","events_url":"https://api.github.com/users/aleneum/events{/privacy}","received_events_url":"https://api.github.com/users/aleneum/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T12:03:08Z","updated_at":"2016-08-18T12:03:08Z","body":"Another approach I was thinking about is to check whether a state acts as a transition source. If the state cannot be left it is implicitly a final state whereas a final state with possible transitions cannot be that final.\r\n\r\n```python\r\nClass Machine(object): \r\n\r\ndef final(self, model): # method is bound to the model(s)\r\n    for ev in self.events:\r\n        if model.state in ev:\r\n            return False\r\n    return True\r\n```\r\n\r\n"}}
{"actor":{"display_login":"aleneum"}}