{"action":"created","issue":{"url":"https://api.github.com/repos/swcarpentry/instructor-retreat-2015/issues/28","labels_url":"https://api.github.com/repos/swcarpentry/instructor-retreat-2015/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/swcarpentry/instructor-retreat-2015/issues/28/comments","events_url":"https://api.github.com/repos/swcarpentry/instructor-retreat-2015/issues/28/events","html_url":"https://github.com/swcarpentry/instructor-retreat-2015/issues/28","id":109521480,"number":28,"title":"Making friends with Python 3","user":{"login":"BillMills","id":1896943,"avatar_url":"https://avatars.githubusercontent.com/u/1896943?v=3","gravatar_id":"","url":"https://api.github.com/users/BillMills","html_url":"https://github.com/BillMills","followers_url":"https://api.github.com/users/BillMills/followers","following_url":"https://api.github.com/users/BillMills/following{/other_user}","gists_url":"https://api.github.com/users/BillMills/gists{/gist_id}","starred_url":"https://api.github.com/users/BillMills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BillMills/subscriptions","organizations_url":"https://api.github.com/users/BillMills/orgs","repos_url":"https://api.github.com/users/BillMills/repos","events_url":"https://api.github.com/users/BillMills/events{/privacy}","received_events_url":"https://api.github.com/users/BillMills/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-02T16:05:07Z","updated_at":"2015-10-06T19:50:40Z","closed_at":null,"body":"@andreww suggested a possible session on migrating to Python 3, and I think this is a great idea; it's not actually that hard in most cases, but it *feels* like a big activation barrier. Two questions:\r\n\r\n - What should go in this session?\r\n - Who is going to lead it?\r\n\r\nAs for content, I don't think we need to cover every single last detail; just stuff likely to impact the basics, like syntactical changes (print -> print()), and basic structural changes like relative imports. Might be neat to see a `2to3` demo too. Any gotchas around notebooks as we move to 3? Or any other ideas.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/swcarpentry/instructor-retreat-2015/issues/comments/145978006","html_url":"https://github.com/swcarpentry/instructor-retreat-2015/issues/28#issuecomment-145978006","issue_url":"https://api.github.com/repos/swcarpentry/instructor-retreat-2015/issues/28","id":145978006,"user":{"login":"waveform80","id":1076190,"avatar_url":"https://avatars.githubusercontent.com/u/1076190?v=3","gravatar_id":"","url":"https://api.github.com/users/waveform80","html_url":"https://github.com/waveform80","followers_url":"https://api.github.com/users/waveform80/followers","following_url":"https://api.github.com/users/waveform80/following{/other_user}","gists_url":"https://api.github.com/users/waveform80/gists{/gist_id}","starred_url":"https://api.github.com/users/waveform80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waveform80/subscriptions","organizations_url":"https://api.github.com/users/waveform80/orgs","repos_url":"https://api.github.com/users/waveform80/repos","events_url":"https://api.github.com/users/waveform80/events{/privacy}","received_events_url":"https://api.github.com/users/waveform80/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T19:50:40Z","updated_at":"2015-10-06T19:50:40Z","body":"If anyone wants a hand with this, let me know - I've written several libraries that operate happily in Python 2.7+ and 3.2+ from a single codebase (mostly educational Pi stuff, e.g. [picamera](https://github.com/waveform80/picamera), [picraft](https://github.com/waveform80/picraft), but some science-related projects too, e.g. [umansysprop](https://github.com/waveform80/umansysprop) and [compoundfiles](https://github.com/waveform80/compoundfiles)) and I'm happy to discuss the methods I use.\r\n\r\nMy method is to try and write my code in an idiomatic Python 3 style, with a compatibility header where required to make Python 2 as much like Python 3 as possible (under the assumption that one day, in the dim and distant future, when Python 2 is finally removed I can theoretically just remove that header and I'll be left with nice clean Python 3 code).\r\n\r\nI'll be at the Manchester retreat, but I can only make the morning (got a friend's wedding in the afternoon!)."}}