{"action":"created","issue":{"url":"https://api.github.com/repos/swig/swig/issues/316","labels_url":"https://api.github.com/repos/swig/swig/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/swig/swig/issues/316/comments","events_url":"https://api.github.com/repos/swig/swig/issues/316/events","html_url":"https://github.com/swig/swig/issues/316","id":55899904,"number":316,"title":"Support for C++11 strongly typed enumerations breaks the code compatibility","user":{"login":"oliora","id":218676,"avatar_url":"https://avatars.githubusercontent.com/u/218676?v=3","gravatar_id":"","url":"https://api.github.com/users/oliora","html_url":"https://github.com/oliora","followers_url":"https://api.github.com/users/oliora/followers","following_url":"https://api.github.com/users/oliora/following{/other_user}","gists_url":"https://api.github.com/users/oliora/gists{/gist_id}","starred_url":"https://api.github.com/users/oliora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliora/subscriptions","organizations_url":"https://api.github.com/users/oliora/orgs","repos_url":"https://api.github.com/users/oliora/repos","events_url":"https://api.github.com/users/oliora/events{/privacy}","received_events_url":"https://api.github.com/users/oliora/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-29T13:41:38Z","updated_at":"2015-01-29T16:27:08Z","closed_at":null,"body":"I have a strongly typed enum, something like:\r\n\r\n```\r\nenum class BatchType {\r\n    None,\r\n    Generation,\r\n    Export,\r\n};\r\n```\r\n\r\nWhen I used SWIG 3.0.0 to generate Python wrapper for this enum I got the following variables defined:\r\n* `None`\r\n* `Generation`\r\n* `Export`.\r\n\r\nAfter switching to SWIG 3.0.4 (which has support for C++11 strongly typed enums) the names have changed to\r\n* `BatchType_None`\r\n* `BatchType_Generation`\r\n* `BatchType_Export`.\r\n\r\nSo my Python code using this enum is broken now.\r\n\r\nI think it's better to generate new style code only if it's explicitly requested by command line parameter or whatever, because minor SWIG update should not break the backward compatibility. Or at least there should be a simple way to ask new SWIG to generate backward compatible code for strongly typed enums.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/swig/swig/issues/comments/72054931","html_url":"https://github.com/swig/swig/issues/316#issuecomment-72054931","issue_url":"https://api.github.com/repos/swig/swig/issues/316","id":72054931,"user":{"login":"oliora","id":218676,"avatar_url":"https://avatars.githubusercontent.com/u/218676?v=3","gravatar_id":"","url":"https://api.github.com/users/oliora","html_url":"https://github.com/oliora","followers_url":"https://api.github.com/users/oliora/followers","following_url":"https://api.github.com/users/oliora/following{/other_user}","gists_url":"https://api.github.com/users/oliora/gists{/gist_id}","starred_url":"https://api.github.com/users/oliora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliora/subscriptions","organizations_url":"https://api.github.com/users/oliora/orgs","repos_url":"https://api.github.com/users/oliora/repos","events_url":"https://api.github.com/users/oliora/events{/privacy}","received_events_url":"https://api.github.com/users/oliora/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T16:27:08Z","updated_at":"2015-01-29T16:27:08Z","body":"@ptomulik agree, it need to be configured. And new enums should be represented in Python as scoped like `BatchType.None` instead of `BatchType_None`.\r\nWe have downgrade the SWIG version back to 3.0.0 so this issue is not urgent. But until fixed it could prevent users from upgrading."}}